[PATCH] D69442: [CVP] prevent propagating poison when substituting edge values into a phi (PR43802)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 14:20:23 PDT 2019


lebedev.ri marked an inline comment as done.
lebedev.ri 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:
> > 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.
I think it may be good to migrate to worklist-based solution.
I'm guessing rerunning CVP until done would come with double the time impact and little to no benefits.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69442/new/

https://reviews.llvm.org/D69442





More information about the llvm-commits mailing list