[llvm-branch-commits] [llvm] [SelectionDAG] isGuaranteedNotToBeUndefOrPoison - add ISD::SELECT handling (PR #200934)

Krzysztof Drewniak via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jun 4 11:48:52 PDT 2026


================
@@ -5804,6 +5804,17 @@ bool SelectionDAG::isGuaranteedNotToBeUndefOrPoison(SDValue Op,
   case ISD::SPLAT_VECTOR:
     return isGuaranteedNotToBeUndefOrPoison(Op.getOperand(0), Kind, Depth + 1);
 
+  case ISD::SELECT: {
+    SDValue Cond = Op.getOperand(0);
+    return !canCreateUndefOrPoison(Op, DemandedElts, Kind,
+                                   /*ConsiderFlags*/ true, Depth) &&
+           isGuaranteedNotToBeUndefOrPoison(Cond, Kind, Depth + 1) &&
----------------
krzysz00 wrote:

Done

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


More information about the llvm-branch-commits mailing list