[PATCH] D126984: [clang] Add initial support for gcc's optimize function attribute
Arthur Eubanks via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 10 10:55:42 PDT 2022
aeubanks added a comment.
In D126984#3574033 <https://reviews.llvm.org/D126984#3574033>, @steplong wrote:
> In D126984#3571573 <https://reviews.llvm.org/D126984#3571573>, @aeubanks wrote:
>
>> IIRC in the past there was a strong preference to not have the pass manager support this sort of thing
>> if you want to support this, there should be an RFC for how the optimization part of this will work as it may require invasive changes to the LLVM pass manager
>>
>> (if this is purely a clang frontend thing then ignore me)
>
> Hmm, this does affect codegen, so I'm not sure if it's purely a clang frontend thing. Maybe someone else can confirm. The motivation behind this was to add support for MSVC's `pragma optimize` in D125723 <https://reviews.llvm.org/D125723>. https://docs.microsoft.com/en-us/cpp/preprocessor/optimize?view=msvc-170
adding `optsize`/`minsize`/`optnone` attributes to functions is fine and is already handled in optimizations, but being able to specify `-O[0-3]` would require a lot of new complexity in the pass manager which would likely not be worth it
I think D125723 <https://reviews.llvm.org/D125723> is fine as is
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126984/new/
https://reviews.llvm.org/D126984
More information about the cfe-commits
mailing list