diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-07-09 11:16:47 +0100 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-07-09 11:16:47 +0100 |
commit | 03fe47a29c95dbda5ecd548e35627bb16f7dfc6d (patch) | |
tree | e5fcd0f23d019e615e4971795d55dd5f085eb22e /llvm/lib/Analysis/ConstantFolding.cpp | |
parent | 397c68202a990c80a71de2816cee413cd5b5865e (diff) | |
download | llvm-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.cpp | 4 |
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."); |