[llvm] 89fe429 - [DAG] canCreateUndefOrPoison - remove isGuaranteedNotToBeUndefOrPoison check for shift nodes (#146502)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 1 04:45:02 PDT 2025


Author: Simon Pilgrim
Date: 2025-07-01T12:44:59+01:00
New Revision: 89fe429262933ee7fcadc717c376e7fad8a48157

URL: https://github.com/llvm/llvm-project/commit/89fe429262933ee7fcadc717c376e7fad8a48157
DIFF: https://github.com/llvm/llvm-project/commit/89fe429262933ee7fcadc717c376e7fad8a48157.diff

LOG: [DAG] canCreateUndefOrPoison - remove isGuaranteedNotToBeUndefOrPoison check for shift nodes (#146502)

No longer necessary now that #146490 has landed - we still have the test coverage from #94145 that covers this.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 8e70ae6a02130..4e4e70138965f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5623,9 +5623,7 @@ bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
   case ISD::SRA:
     // If the max shift amount isn't in range, then the shift can
     // create poison.
-    return !isGuaranteedNotToBeUndefOrPoison(Op.getOperand(1), DemandedElts,
-                                             PoisonOnly, Depth + 1) ||
-           !getValidMaximumShiftAmount(Op, DemandedElts, Depth + 1);
+    return !getValidMaximumShiftAmount(Op, DemandedElts, Depth + 1);
 
   case ISD::CTTZ_ZERO_UNDEF:
   case ISD::CTLZ_ZERO_UNDEF:


        


More information about the llvm-commits mailing list