[llvm] [RISCV][GISel] Select G_SELECT (G_ICMP, A, B) (PR #68247)

Nitin John Raj via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 16:50:54 PDT 2023


nitinjohnraj wrote:

This approach works, but we could probably get the same functionality by importing the required SelectionDAG patterns. Patterns like this:
```
def : SelectCompressOpt<SETEQ>
```
fail to import since we don't have an equivalent instruction for `RISCVISD::SELECT_CC`. We could create an equivalent generic instruction to fix that. 

It would be good because then we don't reinvent this wheel, but it also means we're committing to having -O3 selection for G_SELECT at all optimization levels (since SelectionDAG behaves invariantly on optimization levels). We briefly discussed in the past whether any combine that depends on a previous instruction should be at -O1, but we didn't commit to any decision back then.

I like the approach you've chosen because it lets us be more granular about our optimization levels. I just thought I'd drop this here so that we're all aware of the design choices here.

https://github.com/llvm/llvm-project/pull/68247


More information about the llvm-commits mailing list