[llvm] [DAG] Remove AssertZext if the input is masked (PR #146052)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 16 01:15:24 PDT 2025


================
@@ -15136,21 +15136,31 @@ SDValue DAGCombiner::visitAssertExt(SDNode *N) {
     }
   }
 
-  // If we have (AssertZext (and (AssertSext X, iX), M), iY) and Y is smaller
-  // than X, and the And doesn't change the lower iX bits, we can move the
-  // AssertZext in front of the And and drop the AssertSext.
   if (Opcode == ISD::AssertZext && N0.getOpcode() == ISD::AND &&
-      N0.hasOneUse() && N0.getOperand(0).getOpcode() == ISD::AssertSext &&
-      isa<ConstantSDNode>(N0.getOperand(1))) {
-    SDValue BigA = N0.getOperand(0);
-    EVT BigA_AssertVT = cast<VTSDNode>(BigA.getOperand(1))->getVT();
+      N0.hasOneUse() && isa<ConstantSDNode>(N0.getOperand(1))) {
----------------
RKSimon wrote:

Is the hasOneUse always necessary or just for the assertzext(and(assertsext(X),Y)) case?

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


More information about the llvm-commits mailing list