diff options
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 2c9ea8a..b32dc49 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -2798,6 +2798,29 @@ static bool isKnownNonZeroFromOperator(const Operator *I, // handled in isKnownNonZero. return false; } + case Instruction::ExtractValue: { + const WithOverflowInst *WO; + if (match(I, m_ExtractValue<0>(m_WithOverflowInst(WO)))) { + switch (WO->getBinaryOp()) { + default: + break; + case Instruction::Add: + return isNonZeroAdd(DemandedElts, Depth, Q, BitWidth, + WO->getArgOperand(0), WO->getArgOperand(1), + /*NSW=*/false, + /*NUW=*/false); + case Instruction::Sub: + return isNonZeroSub(DemandedElts, Depth, Q, BitWidth, + WO->getArgOperand(0), WO->getArgOperand(1)); + case Instruction::Mul: + return isNonZeroMul(DemandedElts, Depth, Q, BitWidth, + WO->getArgOperand(0), WO->getArgOperand(1), + /*NSW=*/false, /*NUW=*/false); + break; + } + } + break; + } case Instruction::Call: case Instruction::Invoke: { const auto *Call = cast<CallBase>(I); |