[PATCH] D79720: [IndVarSimplify][LoopUtils] Track rewrite cost per unique BB (PR45835)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 12:23:05 PDT 2020


lebedev.ri added a comment.

In D79720#2029902 <https://reviews.llvm.org/D79720#2029902>, @dmajor wrote:

> In D79720#2029647 <https://reviews.llvm.org/D79720#2029647>, @lebedev.ri wrote:
>
> > Yes, but it is still not obvious to me as to why that happens?
> >  It's the same PHI node, we are asking about the same value, for the same basic block.
> >  Why do we not find expansion first time but do find it second time?
> >  Did we perform some expansion inbetween?
>
>
> If I'm understanding my recording correctly -- the reason the expansion was found the second time was that we expanded the value the first time, immediately after computing `isHighCostExpansion`: https://github.com/llvm/llvm-project/blob/release/10.x/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp#L675


But that doesn't make sense to me.
How/why could have we expanded it if we've decided that it is high cost?
Did we expand it just because, and then not actually used the expansion?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79720





More information about the llvm-commits mailing list