[llvm] [SelectionDAG] Handle more opcodes in canCreateUndefOrPoison (PR #84921)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 07:32:24 PDT 2024


================
@@ -5091,8 +5101,18 @@ bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
   case ISD::BITCAST:
   case ISD::BUILD_VECTOR:
   case ISD::BUILD_PAIR:
+  case ISD::SELECT:
     return false;
 
+  case ISD::SELECT_CC: {
+    // Integer select_cc cannot create undef or poison.
+    if (Op.getOperand(0).getValueType().isInteger())
+      return false;
+
+    // FIXME: Handle FP compares.
----------------
bjope wrote:

Hmm, yes, it is probably just as simple as that (if just making sure we get the cond code  from correct operand). I will updated the patch.

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


More information about the llvm-commits mailing list