[llvm] [DAG] Remove AssertZext if the input is masked (PR #146052)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 16 01:51:14 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))) {
----------------
Pierre-vh wrote:
It's unnecessary I think, especially if we just return N0
https://github.com/llvm/llvm-project/pull/146052
More information about the llvm-commits
mailing list