[llvm-dev] Revisiting/refining the definition of optnone with interprocedural transformations

via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 26 08:47:49 PDT 2021


> I see that the clang attribute 'optnone' patch rC205255 (in 2014) added
> both the IR 'optnone' and 'noinline' attributes.
> 
> If the clang attribute 'optnone' (for debugging purposes) is to be
> renamed,
> I humbly suggest we may consider implementing
> __attribute__((optimize("O0")))
> (limited to "O0" only; other values are not accepted).
> 
> https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html says
> "The optimize attribute should be used for debugging purposes only. It
> is not suitable in production code." which matches our debugging only
> purposes.
> 
> -O0 code already emits 'optnone' and 'noinline' for non-alwaysinline
> functions, so we may not need a new attribute.

Renaming or adding a clang attribute should be proposed on its own
thread on cfe-dev, as it will not have the proper visibility buried
on llvm-dev at the end of a long thread like this one.
--paulr



More information about the llvm-dev mailing list