[PATCH] D69442: [CVP] prevent propagating poison when substituting edge values into a phi (PR43802)
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 25 14:10:58 PDT 2019
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp:201
+ if (auto *CommonInst = dyn_cast<Instruction>(CommonValue))
+ CommonInst->dropPoisonGeneratingFlags();
P->replaceAllUsesWith(CommonValue);
----------------
nikic wrote:
> nikic wrote:
> > I don't think this is sufficient, as poison might come from an earlier instruction CommonValue depends on.
> After looking at the getEdgeValueLocal() implementation, it looks like this should be sufficient after all. The reasoning along the lines of "What value does Y=f(X) given X==C" is only performed for direct users of X.
If any flags are dropped, `processBinOp()` should be called here to attempt to re-infer them.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69442/new/
https://reviews.llvm.org/D69442
More information about the llvm-commits
mailing list