[PATCH] D80975: [SCEV][IndVarSimplify] insert point should not be block front if the front instruction is a PHI

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 23:25:41 PDT 2020


shchenz added a comment.

In D80975#2068089 <https://reviews.llvm.org/D80975#2068089>, @lebedev.ri wrote:

> Naively i would think that ScalarEvolutionExpander should not second-guess/re-guess specified insertion point,
>  and the callers (possibly ScalarEvolutionExpander itself too) should be adjusted to specify `getFirstInsertionPt()` as the insertion point.


Thanks for your comments. Update accordingly.

Except the changes in the patch, I also went through all `ExpandCodeFor` calling in llvm code base, below one is what I am not sure of:

LoopUtils.cpp, Line 1402:

  for (RewritePhi &Phi : RewritePhiSet) {
    Phi.Expansion = Rewriter.expandCodeFor(Phi.ExpansionSCEV, Phi.PN->getType(),
                                           Phi.ExpansionPoint);

`Phi.ExpansionPoint` is set as phi node's incoming value. I can not find a doc indicates that PHI’s incoming can not be another PHI, if so I think if Phi.ExpansionPoint can be a PHI, then we also have the same issue?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80975





More information about the llvm-commits mailing list