[llvm] [AMDGPU] Switch V_CNDMASK operands to shrink it into VOP2 (PR #135162)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 05:22:35 PDT 2025


================
@@ -973,6 +1083,10 @@ bool SIShrinkInstructions::run(MachineFunction &MF) {
         continue;
       }
 
+      if (MI.getOpcode() == AMDGPU::V_CNDMASK_B32_e64 &&
----------------
jayfoad wrote:

I still find it quite confusing how you use OldVCC and NewVCC to track state.

Do you think it might be simpler to drive this all from the compare instruction instead, like:
```
  if (isVOPC(MI) && ...) {
    invert the compare in-place and swap the operands of all its users in-place
  }
```

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


More information about the llvm-commits mailing list