1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

ConstantFoldScalarCall3 - use const APInt& returned by getValue()

Avoids unnecessary APInt copies and silences clang tidy warning.
This commit is contained in:
Simon Pilgrim 2020-07-09 11:16:47 +01:00
parent beb00ef3a0
commit 445824c25e

View File

@ -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.");