[llvm] [ValueTracking] Add support for overflow detection functions is `isKnownNonZero` (PR #87701)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 5 06:08:32 PDT 2024
================
@@ -2786,6 +2791,35 @@ static bool isKnownNonZeroFromOperator(const Operator *I,
// handled in isKnownNonZero.
return false;
}
+ case Instruction::ExtractValue:
+ if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(I->getOperand(0))) {
+ const ExtractValueInst *EVI = cast<ExtractValueInst>(I);
+ if (EVI->getNumIndices() != 1 || EVI->getIndices()[0] != 0)
+ break;
----------------
dtcxzyw wrote:
```suggestion
const WithOverflowInst *WO;
if (match(I, m_ExtractValue<0>(m_WithOverflowInst(WO)))) {
```
https://github.com/llvm/llvm-project/pull/87701
More information about the llvm-commits
mailing list