Skip to content

Commit d341911

Browse files
authored
[Metadata] Use const APInt &. NFC (#101865)
getValue returns a const APInt &. So using a const APInt & will avoid a copy.
1 parent 8dd065d commit d341911

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/IR/Metadata.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,8 +1250,8 @@ static bool tryMergeRange(SmallVectorImpl<ConstantInt *> &EndPoints,
12501250
ConstantInt *Low, ConstantInt *High) {
12511251
ConstantRange NewRange(Low->getValue(), High->getValue());
12521252
unsigned Size = EndPoints.size();
1253-
APInt LB = EndPoints[Size - 2]->getValue();
1254-
APInt LE = EndPoints[Size - 1]->getValue();
1253+
const APInt &LB = EndPoints[Size - 2]->getValue();
1254+
const APInt &LE = EndPoints[Size - 1]->getValue();
12551255
ConstantRange LastRange(LB, LE);
12561256
if (canBeMerged(NewRange, LastRange)) {
12571257
ConstantRange Union = LastRange.unionWith(NewRange);

0 commit comments

Comments
 (0)