[llvm] [AMDGPU][SDAG] Support source modifiers as integer on select (PR #147325)

Janek van Oirschot via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 7 09:21:49 PDT 2025


================
@@ -4830,6 +4830,65 @@ AMDGPUTargetLowering::foldFreeOpFromSelect(TargetLowering::DAGCombinerInfo &DCI,
   return SDValue();
 }
 
+static EVT IntToFloatVT(EVT VT) {
+  return VT = VT.isVector() ? MVT::getVectorVT(MVT::getFloatingPointVT(
+                                                   VT.getScalarSizeInBits()),
+                                               VT.getVectorNumElements())
+                            : MVT::getFloatingPointVT(VT.getFixedSizeInBits());
+}
+
+static SDValue BitwiseToSrcModifierOp(SDValue N,
+                                      TargetLowering::DAGCombinerInfo &DCI) {
+
+  unsigned Opc = N.getNode()->getOpcode();
+  if (Opc != ISD::AND && Opc != ISD::XOR && Opc != ISD::AND)
+    return SDValue();
+
+  SelectionDAG &DAG = DCI.DAG;
+  SDValue LHS = N.getNode()->getOperand(0);
+  SDValue RHS = N.getNode()->getOperand(1);
----------------
JanekvO wrote:

```suggestion
  SDValue LHS = N->getOperand(0);
  SDValue RHS = N->getOperand(1);
```

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


More information about the llvm-commits mailing list