[PATCH] D139858: [SCEVExpander] Increase "cheap" expansion budget for loop invariants, but not loop exit values

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 07:01:07 PST 2022


nikic added a comment.

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

> In D139858#4001178 <https://reviews.llvm.org/D139858#4001178>, @nikic wrote:
>
>> I'd be more comfortable with this if it adjusted just the unroll limit, where a higher cost is probably justifiable relative to the cost of everything else.
>> This change affects a lot of transforms, and from the test diffs alone, some of them look non-profitable to me, e.g. most of the changes in llvm/test/Transforms/IndVarSimplify/post-inc-range.ll due to questionable LFTR transforms.
>
> I'm not sure i understand. This kind of change we see in post-inc-range.ll, is exactly why i bothered to unbreak the original `isHighCostExpansion` originally in the first place.

I'm probably missing some subtlety of IV canonicalization here. As far as I can tell those transforms a) add more instructions outside the loop, b) add more instructions inside the loop and c) introduce a trunc inside the loop, which is an analysis blocker (ext is better than trunc) and all that to convert an slt into ne for an IV we can already analyze as-is. If there's a benefit to all this, it's not obvious to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139858



More information about the llvm-commits mailing list