[llvm] r336491 - Use const APInt& to avoid extra copy. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 7 10:33:48 PDT 2018
Author: rksimon
Date: Sat Jul 7 10:33:48 2018
New Revision: 336491
URL: http://llvm.org/viewvc/llvm-project?rev=336491&view=rev
Log:
Use const APInt& to avoid extra copy. NFCI.
As discussed on D48825.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=336491&r1=336490&r2=336491&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Sat Jul 7 10:33:48 2018
@@ -1461,7 +1461,7 @@ bool TargetLowering::SimplifyDemandedVec
SDValue Sub = Op.getOperand(1);
EVT SubVT = Sub.getValueType();
unsigned NumSubElts = SubVT.getVectorNumElements();
- APInt Idx = cast<ConstantSDNode>(Op.getOperand(2))->getAPIntValue();
+ const APInt& Idx = cast<ConstantSDNode>(Op.getOperand(2))->getAPIntValue();
if (Idx.uge(NumElts - NumSubElts))
break;
unsigned SubIdx = Idx.getZExtValue();
More information about the llvm-commits
mailing list