Skip to content

Commit 81b644f

Browse files
committed
[RISCV] Assume constant shift amount
1 parent 750a26a commit 81b644f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21571,8 +21571,9 @@ void RISCVTargetLowering::computeKnownBitsForTargetNode(const SDValue Op,
2157121571
case RISCVISD::SHL_ADD: {
2157221572
KnownBits Known2;
2157321573
Known = DAG.computeKnownBits(Op.getOperand(0), DemandedElts, Depth + 1);
21574-
Known2 = DAG.computeKnownBits(Op.getOperand(1), DemandedElts, Depth + 1);
21575-
Known = KnownBits::shl(Known, Known2);
21574+
unsigned ShAmt = Op.getConstantOperandVal(1);
21575+
Known <<= ShAmt;
21576+
Known.Zero.setLowBits(ShAmt); // the <<= operator left these bits unknown
2157621577
Known2 = DAG.computeKnownBits(Op.getOperand(2), DemandedElts, Depth + 1);
2157721578
Known = KnownBits::add(Known, Known2);
2157821579
break;

0 commit comments

Comments
 (0)