[llvm] [AMDGPU] Recognise bitmask operations as srcmods (PR #149110)

Janek van Oirschot via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 18 04:10:05 PDT 2025


================
@@ -3036,6 +3036,36 @@ bool AMDGPUDAGToDAGISel::SelectVOP3ModsImpl(SDValue In, SDValue &Src,
     Src = Src.getOperand(0);
   }
 
----------------
JanekvO wrote:

Can probably guard on the common parts of  the if-nests here
i.e.,
```

if (!isBitwiseAndOrXor(Src->getOpcode()) || Src.getValueType().getFixedSizeInBits() == 16) // Alternatively, check here if Src has 2 operands and check for and/or/xor later
  return true;
ConstantSDNode *CRHS = dyn_cast<ConstantSDNode>(Src->getOperand(1)); // Still have to check whether CRHS exists
```

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


More information about the llvm-commits mailing list