Skip to content

Commit 825e517

Browse files
committed
[DAG] computeKnownBits - Replace ISD::MUL handling with the common KnownBits::computeForMul implementation
1 parent 93cbf62 commit 825e517

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,20 +2879,7 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts,
28792879
case ISD::MUL: {
28802880
Known = computeKnownBits(Op.getOperand(1), DemandedElts, Depth + 1);
28812881
Known2 = computeKnownBits(Op.getOperand(0), DemandedElts, Depth + 1);
2882-
2883-
// If low bits are zero in either operand, output low known-0 bits.
2884-
// Also compute a conservative estimate for high known-0 bits.
2885-
// More trickiness is possible, but this is sufficient for the
2886-
// interesting case of alignment computation.
2887-
unsigned TrailZ = Known.countMinTrailingZeros() +
2888-
Known2.countMinTrailingZeros();
2889-
unsigned LeadZ = std::max(Known.countMinLeadingZeros() +
2890-
Known2.countMinLeadingZeros(),
2891-
BitWidth) - BitWidth;
2892-
2893-
Known.resetAll();
2894-
Known.Zero.setLowBits(std::min(TrailZ, BitWidth));
2895-
Known.Zero.setHighBits(std::min(LeadZ, BitWidth));
2882+
Known = KnownBits::computeForMul(Known, Known2);
28962883
break;
28972884
}
28982885
case ISD::UDIV: {

0 commit comments

Comments
 (0)