[llvm] [AMDGPU] Swap select operands to allow later v_cndmask shrinking into vop2 (PR #142354)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 01:25:19 PDT 2025


jayfoad wrote:

> It is a bit of a vexing issue and I don't have a good answer for it, but it's also problematic that we don't seem to have a good answer for it. If we stay limited to SelectionDAG: Is it acceptable to replace _other_ nodes of the DAG from this method somehow?

Yeah, this is what I hinted at above:

> Maybe the best of both worlds would be to write it as a DAGCombine that vists the SETCC node instead of the SELECT?

I _think_ it's OK to write a combiner that visits the SETCC but also modifies all the SELECT users of that SETCC. At worst you might have to manually add those SELECTs to the DAG combiner's worklist.

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


More information about the llvm-commits mailing list