diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-31 09:58:50 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-31 09:58:50 +0000 |
commit | ac5821395bb8f019032ddf9f2eb4746ceedaf1c3 (patch) | |
tree | 2936fac4e1fc02c71f3ac7fce3cef2858da0b0cc /llvm/lib/Analysis | |
parent | a91f72927967a7279c850b9fea0d8120d0791126 (diff) | |
download | bcm5719-llvm-ac5821395bb8f019032ddf9f2eb4746ceedaf1c3.tar.gz bcm5719-llvm-ac5821395bb8f019032ddf9f2eb4746ceedaf1c3.zip |
[LVI] Extract solveBlockValueExtractValue(); NFC
Extract this method in preparation for additional extractvalue
support.
llvm-svn: 370575
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 6c6fe8730b6..bfe9aeda296 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -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::solveBlockValueImpl(ValueLatticeElement &Res, 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::solveBlockValueIntrinsic( } } +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); |