[PATCH] D59926: Constant folding sometimes creates large constants even though a smaller constant is used multiple times

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 05:12:40 PDT 2019


lebedev.ri added a comment.

In D59926#1445822 <https://reviews.llvm.org/D59926#1445822>, @ramred01 wrote:

> In D59926#1445820 <https://reviews.llvm.org/D59926#1445820>, @lebedev.ri wrote:
>
> > This sounds like a back-end problem.
> >  Have you considered/tried solving it there, instead of limiting the middle-end?
>
>
> This folding is happening in the middle-end itself.  The LLVM IR already has the folded value.


That is precisely my point. Is that folding not optimal for the IR?

> Hence we thought it best to handle it there as this should be affecting multiple architectures where materializing constants can take two or more instructions.

Have you considered the case where you *already* had that IR?
Even thought the middle end did not 'degrade' it, it will still not be handled by back-ends 'properly', right?


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

https://reviews.llvm.org/D59926





More information about the llvm-commits mailing list