[PATCH] D96929: [ValueTracking] Improve impliesPoison
Juneyoung Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 18 18:51:18 PST 2021
aqjune marked an inline comment as done.
aqjune added inline comments.
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4888-4890
+ if (isa<ExtractValueInst>(I) && isa<ExtractValueInst>(ValAssumedPoison)) {
+ if (I->getOperand(0) == I2->getOperand(0) &&
+ isAllPoisonOrNot(I->getOperand(0)))
----------------
spatel wrote:
> Are there other patterns that you are planning to add here?
> If not, we could make the patch much smaller with a more direct match like we use in InstCombineSelect.cpp:
> WithOverflowInst *II;
> if (!match(CondVal, m_ExtractValue<1>(m_WithOverflowInst(II))) ||
> !match(FalseVal, m_ExtractValue<0>(m_Specific(II))))
> return nullptr;
Yep, I think dealing with overflow instructions is enough.
I updated the code to use matches (with updates in PatternMatch.h)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96929/new/
https://reviews.llvm.org/D96929
More information about the llvm-commits
mailing list