diff options
author | Craig Topper <craig.topper@intel.com> | 2017-08-04 16:59:29 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-08-04 16:59:29 +0000 |
commit | 4e22ee6745d12c935ee29cb1fbc99d753adf125f (patch) | |
tree | 85d9e5f75c2884e43dd6a18023e68630c061c8b8 /llvm/lib/Analysis/LazyValueInfo.cpp | |
parent | 14fc82a1df40cdf09e969ae2b5f172d474e25d4a (diff) | |
download | bcm5719-llvm-4e22ee6745d12c935ee29cb1fbc99d753adf125f.tar.gz bcm5719-llvm-4e22ee6745d12c935ee29cb1fbc99d753adf125f.zip |
[ConstantInt] Use ConstantInt::getValue instead of Constant::getUniqueInteger in a few places where we obviously have a ConstantInt. NFC
getUniqueInteger will ultimately call ConstantInt::getValue, but calling ConstantInt::getValue should be inlined.
llvm-svn: 310069
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index e6b013f79a7..e72eedeaabe 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -151,7 +151,7 @@ public: Optional<APInt> asConstantInteger() const { if (isConstant() && isa<ConstantInt>(Val)) { - return Val->getUniqueInteger(); + return cast<ConstantInt>(Val)->getValue(); } else if (isConstantRange() && Range.isSingleElement()) { return *Range.getSingleElement(); } @@ -1384,7 +1384,7 @@ static LVILatticeVal constantFoldUser(Value *Val, Value *Op, if (auto *C = dyn_cast_or_null<ConstantInt>( SimplifyCastInst(CI->getOpcode(), OpConst, CI->getDestTy(), DL))) { - return LVILatticeVal::getRange(ConstantRange(C->getUniqueInteger())); + return LVILatticeVal::getRange(ConstantRange(C->getValue())); } } else if (auto *BO = dyn_cast<BinaryOperator>(Val)) { bool Op0Match = BO->getOperand(0) == Op; @@ -1395,7 +1395,7 @@ static LVILatticeVal constantFoldUser(Value *Val, Value *Op, Value *RHS = Op1Match ? OpConst : BO->getOperand(1); if (auto *C = dyn_cast_or_null<ConstantInt>( SimplifyBinOp(BO->getOpcode(), LHS, RHS, DL))) { - return LVILatticeVal::getRange(ConstantRange(C->getUniqueInteger())); + return LVILatticeVal::getRange(ConstantRange(C->getValue())); } } return LVILatticeVal::getOverdefined(); |