aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ConstantFolding.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-07-09 11:16:47 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-07-09 11:16:47 +0100
commit03fe47a29c95dbda5ecd548e35627bb16f7dfc6d (patch)
treee5fcd0f23d019e615e4971795d55dd5f085eb22e /llvm/lib/Analysis/ConstantFolding.cpp
parent397c68202a990c80a71de2816cee413cd5b5865e (diff)
downloadllvm-03fe47a29c95dbda5ecd548e35627bb16f7dfc6d.zip
llvm-03fe47a29c95dbda5ecd548e35627bb16f7dfc6d.tar.gz
llvm-03fe47a29c95dbda5ecd548e35627bb16f7dfc6d.tar.bz2
ConstantFoldScalarCall3 - use const APInt& returned by getValue()
Avoids unnecessary APInt copies and silences clang tidy warning.
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r--llvm/lib/Analysis/ConstantFolding.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 76e7b29..a414336 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -2607,8 +2607,8 @@ static Constant *ConstantFoldScalarCall3(StringRef Name,
// how rounding should be done, and provide their own folding to be
// consistent with rounding. This is the same approach as used by
// DAGTypeLegalizer::ExpandIntRes_MULFIX.
- APInt Lhs = Op1->getValue();
- APInt Rhs = Op2->getValue();
+ const APInt &Lhs = Op1->getValue();
+ const APInt &Rhs = Op2->getValue();
unsigned Scale = Op3->getValue().getZExtValue();
unsigned Width = Lhs.getBitWidth();
assert(Scale < Width && "Illegal scale.");