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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 10:27:43 PST 2024


dwblaikie wrote:

I haven't done proper A/B debugging before and after this patch yet - but you might be right that the code is currently was previously falling under partial unrolling - but I don't know why it would count as partial unrolling?

The code here https://github.com/llvm/llvm-project/blob/f872706615cb928ec35ea35280536b59a22a2bf2/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp#L791-L805

If I'm reading this right, it doesn't look like it treats PragmaFullUnroll and PragmaEnableUnroll equally - or perhaps clang is mis-lowering pragma without a bound & it should be lowering it to pragma full unroll?

The LLVM docs: https://llvm.org/docs/TransformMetadata.html#loop-unrolling don't seem to be super clear about what the different IR metadata means?




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


More information about the llvm-commits mailing list