Commit 2a40ec2d authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

[DAG] SimplifyDemandedBits - fix isOperationLegal typo in D146121

We need to check that the simplified ISD::SRL node is legal, not the old one

Noticed while trying to isolate the regressions in D155472
parent d816c221
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1897,7 +1897,7 @@ bool TargetLowering::SimplifyDemandedBits(
        if (isNarrowingProfitable(VT, HalfVT) &&
            isTypeDesirableForOp(ISD::SRL, HalfVT) &&
            isTruncateFree(VT, HalfVT) && isZExtFree(HalfVT, VT) &&
            (!TLO.LegalOperations() || isOperationLegal(ISD::SRL, VT)) &&
            (!TLO.LegalOperations() || isOperationLegal(ISD::SRL, HalfVT)) &&
            ((InDemandedMask.countLeadingZeros() >= (BitWidth / 2)) ||
             TLO.DAG.MaskedValueIsZero(Op0, HiBits))) {
          SDValue NewOp = TLO.DAG.getNode(ISD::TRUNCATE, dl, HalfVT, Op0);