[Bug middle-end/124707] Provide `#pragma GCC loop nolim` which disables gimple level lim (NOT PRE) for a specific loop

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 31 09:47:41 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124707

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Alexander Monakov from comment #3)
> Yeah, the motivation is unclear. For reference, the preceding LLVM change
> adding the llvm.loop.licm.disable annotation is here:
> https://reviews.llvm.org/D64557
> 
> It mentions AMDGPU codegen trouble, with LICM increasing register pressure
> too much, but without further context it really looks like a "big hammer"
> approach.
> 
> I'm surprised you're entertaining the idea of exposing ad-hoc codegen
> limiters via a pragma like that. Such things need to be supported in both
> GIMPLE and RTL lands somehow. And for what gain?

It might be a tool for performance tuning.  We do expose optimization
passes control at the function level via the optimize attribute and
with the disadvantage of limiting inlining as a side-effect.  That's
hardly useful besides for debugging or working around bugs.

But of course I'm not exactly entertaining it ... it does make somewhat
sense to allow the user to tune things where GCC lacks any restraint
itself - aka LICM has no (useful) cost modeling.


More information about the Gcc-bugs mailing list