[llvm] [LoopUnroll] Introduce PragmaUnrollFullMaxIterations as a hard cap on how many iterations we try to unroll (PR #78648)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 10:38:02 PST 2024


nikic wrote:

> Oh, the docs also say "#pragma unroll and #pragma unroll _value_ have identical semantics to #pragma clang loop unroll(full) and #pragma clang loop unroll_count(_value_) respectively. " - so that doesn't sound like `#pragma clang loop unroll(full)` would help the situation?

You're looking at some very old docs there. The current ones are https://clang.llvm.org/docs/AttributeReference.html#pragma-unroll-pragma-nounroll and they have the s/full/enable typo fixed.

The unrolling heuristics are very complex and it's hard to make any definitive statements without a reproducer. Based on what you say, I *suspect* that this patch has moved a partial unroll from happening in the full unroll pass to the runtime unroll pass and that exposed a second order compile-time issue in your case. Or it might be something else entirely...

https://github.com/llvm/llvm-project/pull/78648


More information about the llvm-commits mailing list