[llvm] r370575 - [LVI] Extract solveBlockValueExtractValue(); NFC
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 31 02:58:50 PDT 2019
Author: nikic
Date: Sat Aug 31 02:58:50 2019
New Revision: 370575
URL: http://llvm.org/viewvc/llvm-project?rev=370575&view=rev
Log:
[LVI] Extract solveBlockValueExtractValue(); NFC
Extract this method in preparation for additional extractvalue
support.
Modified:
llvm/trunk/lib/Analysis/LazyValueInfo.cpp
Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=370575&r1=370574&r2=370575&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Sat Aug 31 02:58:50 2019
@@ -434,6 +434,8 @@ namespace {
ValueLatticeElement &BBLV, WithOverflowInst *WO, BasicBlock *BB);
bool solveBlockValueIntrinsic(ValueLatticeElement &BBLV, IntrinsicInst *II,
BasicBlock *BB);
+ bool solveBlockValueExtractValue(ValueLatticeElement &BBLV,
+ ExtractValueInst *EVI, BasicBlock *BB);
void intersectAssumeOrGuardBlockValueConstantRange(Value *Val,
ValueLatticeElement &BBLV,
Instruction *BBI);
@@ -648,9 +650,7 @@ bool LazyValueInfoImpl::solveBlockValueI
return solveBlockValueBinaryOp(Res, BO, BB);
if (auto *EVI = dyn_cast<ExtractValueInst>(BBI))
- if (auto *WO = dyn_cast<WithOverflowInst>(EVI->getAggregateOperand()))
- if (EVI->getNumIndices() == 1 && *EVI->idx_begin() == 0)
- return solveBlockValueOverflowIntrinsic(Res, WO, BB);
+ return solveBlockValueExtractValue(Res, EVI, BB);
if (auto *II = dyn_cast<IntrinsicInst>(BBI))
return solveBlockValueIntrinsic(Res, II, BB);
@@ -1135,6 +1135,18 @@ bool LazyValueInfoImpl::solveBlockValueI
}
}
+bool LazyValueInfoImpl::solveBlockValueExtractValue(
+ ValueLatticeElement &BBLV, ExtractValueInst *EVI, BasicBlock *BB) {
+ if (auto *WO = dyn_cast<WithOverflowInst>(EVI->getAggregateOperand()))
+ if (EVI->getNumIndices() == 1 && *EVI->idx_begin() == 0)
+ return solveBlockValueOverflowIntrinsic(BBLV, WO, BB);
+
+ LLVM_DEBUG(dbgs() << " compute BB '" << BB->getName()
+ << "' - overdefined (unknown extractvalue).\n");
+ BBLV = ValueLatticeElement::getOverdefined();
+ return true;
+}
+
static ValueLatticeElement getValueFromICmpCondition(Value *Val, ICmpInst *ICI,
bool isTrueDest) {
Value *LHS = ICI->getOperand(0);
More information about the llvm-commits
mailing list