[PATCH] D119148: [LoopUnroll] Always respect user unroll pragma

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 20:16:04 PST 2022


Whitney added a comment.

In D119148#3330896 <https://reviews.llvm.org/D119148#3330896>, @efriedma wrote:

> I think the limit is there just to prevent the compiler from exploding.  If you try to unroll too much, you're going to end up with effectively infinite compile time and/or run out of memory.
>
> I would expect it's unlikely to trigger the limit in practice; do you have a practical case where it matters?

We had a change to make certain kinds of instructions return `InstructionCost::getMax()` from `getUserCost()`, as we want to prevent optimizations like unrolling to happen for loops containing those instructions. (It is reverted.)
We were surprised to see that loops with user pragma were also affected. IMO it is user's responsibility to put pragmas that make sense. 
IIUC if there is user pragma, we should always respect it. I don't feel too strongly about it, I mostly want to understand what's the level we want to respect user pragma to.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119148



More information about the llvm-commits mailing list