[llvm] [AMDGPU] si-peephole-sdwa: Disable V_CNDMASK_B32 conversion with sext (PR #140760)

Frederik Harwath via llvm-commits llvm-commits at lists.llvm.org
Tue May 20 22:54:17 PDT 2025


================
@@ -430,6 +430,13 @@ bool SDWASrcOperand::convertToSDWA(MachineInstr &MI, const SIInstrInfo *TII) {
   case AMDGPU::V_CVT_PK_F32_BF8_sdwa:
     // Does not support input modifiers: noabs, noneg, nosext.
     return false;
+  case AMDGPU::V_CNDMASK_B32_sdwa:
+    // FIXME SISrcMods uses the same bitmask for SEXT and NEG
----------------
frederik-h wrote:

> Is it only this one bit?

`NEG_HI = ABS` could be problematic, but I have not looked into the implications of this definition in detail yet.

```C
  // Input operand modifiers bit-masks
  // NEG and SEXT share same bit-mask because they can't be set simultaneously.
namespace SISrcMods {
    enum : unsigned {
     NONE = 0,
     NEG = 1 << 0,   // Floating-point negate modifier
     ABS = 1 << 1,   // Floating-point absolute modifier
     SEXT = 1 << 0,  // Integer sign-extend modifier
     NEG_HI = ABS,   // Floating-point negate high packed component modifier.
     OP_SEL_0 = 1 << 2,
     OP_SEL_1 = 1 << 3,
     DST_OP_SEL = 1 << 3 // VOP3 dst op_sel (share mask with OP_SEL_1)
    };
}
```

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


More information about the llvm-commits mailing list