diff options
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/BranchProbabilityInfo.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp index 3748c651fd2..6008c353a08 100644 --- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp +++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp @@ -496,7 +496,7 @@ bool BranchProbabilityInfo::calcZeroHeuristics(const BasicBlock *BB, if (Instruction *LHS = dyn_cast<Instruction>(CI->getOperand(0))) if (LHS->getOpcode() == Instruction::And) if (ConstantInt *AndRHS = dyn_cast<ConstantInt>(LHS->getOperand(1))) - if (AndRHS->getUniqueInteger().isPowerOf2()) + if (AndRHS->getValue().isPowerOf2()) return false; // Check if the LHS is the return value of a library function 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(); |