Are Multi Output Instructions and PDLL's Multi Result Operations the same?

Date: 26.04.2024

I have been recently to the LLVM Developer Meeting 2024 in Vienna. It was quite interesting for me since most talks were about MLIR. However, I am only working with the RISC-V compiler backend for my master's thesis.
Specifically, I am interested in instruction selection. Instruction selection is a phase where the compiler transforms a program's intermediate representation into machine instructions. A poor selection means that a lot of CPU cycles get wasted and the program runs slower than it would need to.
In my thesis, I focus on Multiple Output Instructions. As the name states those are instructions which return multiple results. [1] But the difficulty with those instructions is the pattern matching. The existing dynamic programming and tree covering algorithms are optimal; however, only on trees. A multiple output instruction pattern is not a tree but a DAG. DAG covering is known to be NP-complete. For example, an ADD instruction writes the result into one register. Whereas, a DIV-MOD instruction writes the result of the division into one register and the result of the modulo into another register. The upstream backends solve this by using a peephole optimization pass after the instruction selection.
At the conference, someone pointed out that there might be a new instruction selector called PDLL for MLIR [2]. This was quite interesting for me because my research group has developed a proprietary TableGen extension which extends the pattern matching to support DAGs. An upstreamed instruction selector would be very beneficial for me since it would make my work reproducible.
Unfortunately, I saw that Multi Result Operations are not the same as Multi Output Instructions after looking at the tutorial page [3]. PDLL seems to be able to emit multiple instructions; however, I could not find any information regarding the pattern matching. And from my perspective, it is not possible to match DAG patterns. So PDLL does unfortunately not solve the Multi Output Instruction Problem for me.

References:
[1]: Instruction Selection by Gabriel Hjort Blindell
[2]: https://mlir.llvm.org/docs/PDLL/ accessed 26.04.2024
[3]: https://mlir.llvm.org/docs/PDLL/#multi-result-operations accessed 26.04.2024