diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-05-06 05:15:09 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-05-06 05:15:09 +0000 |
commit | 8f26b7945e6befe911b563737a6d23db1ae95c58 (patch) | |
tree | 9bbe62164f3bb86a436afaf9eabdd25e69fca1f5 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 2b195fd2c358b66d9f6b7bde7d06fed74c8ef81d (diff) | |
download | bcm5719-llvm-8f26b7945e6befe911b563737a6d23db1ae95c58.tar.gz bcm5719-llvm-8f26b7945e6befe911b563737a6d23db1ae95c58.zip |
[SCEV] Avoid a couple APInt copies by capturing by reference since the method returns a reference.
llvm-svn: 302332
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 8c5813a43c7..2ae4014bd62 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -8943,7 +8943,7 @@ bool ScalarEvolution::isImpliedCondOperandsViaRanges(ICmpInst::Predicate Pred, if (!Addend) return false; - APInt ConstFoundRHS = cast<SCEVConstant>(FoundRHS)->getAPInt(); + const APInt &ConstFoundRHS = cast<SCEVConstant>(FoundRHS)->getAPInt(); // `FoundLHSRange` is the range we know `FoundLHS` to be in by virtue of the // antecedent "`FoundLHS` `Pred` `FoundRHS`". @@ -8955,7 +8955,7 @@ bool ScalarEvolution::isImpliedCondOperandsViaRanges(ICmpInst::Predicate Pred, // We can also compute the range of values for `LHS` that satisfy the // consequent, "`LHS` `Pred` `RHS`": - APInt ConstRHS = cast<SCEVConstant>(RHS)->getAPInt(); + const APInt &ConstRHS = cast<SCEVConstant>(RHS)->getAPInt(); ConstantRange SatisfyingLHSRange = ConstantRange::makeSatisfyingICmpRegion(Pred, ConstRHS); |