[llvm] [AArch64] Allow forcing unrolling of small loops (PR #167488)
Vladi Krapp via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 12 06:20:41 PST 2025
VladiKrapp-Arm wrote:
> Would it be possible to detect small loops which are beneficial for unrolling automatically for a given CPU, instead of just having a very broad flag?
In general, yes, that's a great future direction to follow up on! Preliminary results seem to indicate that loops with pointer chasing benefit more than ones without, so there should be some heuristics we can use there. There's much more research to be done though.
For now, we can give a simple general tool that's following on [existing practice in aarch32](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp#L2731)
This way the default behaviour remains the same, while allowing the user to pick their own tradeoffs without going down to a per-function or per-loop resolution with pragmas.
https://github.com/llvm/llvm-project/pull/167488
More information about the llvm-commits
mailing list