Skip to content

Commit 9d792fe

Browse files
committed
[RISCV] Remove unnecessary APInt copy. NFC
getAPIntValue returns a const APInt& so keep it as a reference.
1 parent b8b5e87 commit 9d792fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,7 @@ bool RISCVTargetLowering::isDesirableToCommuteWithShift(
20092009
auto *C1 = dyn_cast<ConstantSDNode>(N0->getOperand(1));
20102010
auto *C2 = dyn_cast<ConstantSDNode>(N->getOperand(1));
20112011
if (C1 && C2) {
2012-
APInt C1Int = C1->getAPIntValue();
2012+
const APInt &C1Int = C1->getAPIntValue();
20132013
APInt ShiftedC1Int = C1Int << C2->getAPIntValue();
20142014

20152015
// We can materialise `c1 << c2` into an add immediate, so it's "free",

0 commit comments

Comments
 (0)