[PATCH] D75790: [PowerPC] Fix compile time issue in recursive CTR analysis code

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 19:09:54 PDT 2020


tejohnson added a comment.

In D75790#1915719 <https://reviews.llvm.org/D75790#1915719>, @MaskRay wrote:

> In D75790#1915671 <https://reviews.llvm.org/D75790#1915671>, @tejohnson wrote:
>
> > In D75790#1915590 <https://reviews.llvm.org/D75790#1915590>, @MaskRay wrote:
> >
> > > Generally looks good, but the title needs to be clarified. This piece of code is related to an optimization which uses CTR as the loop count register.
> >
> >
> > Updated the title.
> >
> > > For context, D6786 <https://reviews.llvm.org/D6786> introduced `mightUseCTR`.  rL251582 <https://reviews.llvm.org/rL251582> made it recurse into the constant.
> > > 
> > > IIUC, with ThinLTO's ImportConstantsWithRefs optimization, a constant can be very large, and recursing into it for every instruction can make the compilation slow. Is that the case?
> >
> > No, the constant itself was quite simple. Importing it simply enabled some additional optimization (in IndVarSimplify) that created a huge instruction expression. It was iterating that expression, not the constant itself, that is so slow.
>
>
> It'd be nice to give a (reduced) example in the description, even if testing it reliably may be unrealistic.


I showed the start of the expression that causes the analysis to re-analyze the same operand many times.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75790





More information about the llvm-commits mailing list