[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-14 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. FWIW, I think we should have these attributes as spelled here, just w/ proper pass manager integration which then requires an RFC. That said, I'm not opposed to this as an incremental step, albeit confusing until the PM support is integrated if we allow O1

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-14 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Also note that there is a '#pragma GCC optimize' pragma. After this patch, it should be hard to implement it. https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-14 Thread Stephen Long via Phabricator via cfe-commits
steplong added a comment. > I appreciate your patience while we figure out the right approach here; we > don't usually have this many false starts when working through a feature > review. :-) No worries, I appreciate the community doing the due diligence. Repository: rG LLVM Github Monorepo

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D126984#3582508 , @steplong wrote: > I'm open to tabling this and just implementing support for an empty > optimization list for the pragma (i.e. `#pragma optimize("", on | off)`). For > our use case, at the moment, we

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-14 Thread Stephen Long via Phabricator via cfe-commits
steplong added a comment. I'm open to tabling this and just implementing support for an empty optimization list for the pragma (i.e. `#pragma optimize("", on | off)`). For our use case, at the moment, we only see the pragma being used this way. Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-14 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. >> That's not stopped us from exposing attributes like minsize (and you >> proposed optsize as well) which get described in the same terms as -Os/-Oz >> in our documentation, so this ship has somewhat sailed. Well, there is no promise that attribute matches -O flag in

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D126984#3581829 , @xbolva00 wrote: > I was thinking about this again and I am more and more unsure about this > feature. -Os/-Oz is something more than just some attribute. That's not stopped us from exposing attributes

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-14 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. In D126984#3581708 , @aaron.ballman wrote: > In D126984#3579842 , @jdoerfert > wrote: > >> In D126984#3571573 , @aeubanks >> wrote: >> >>> IIR

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D126984#3579842 , @jdoerfert wrote: > In D126984#3571573 , @aeubanks > wrote: > >> IIRC in the past there was a strong preference to not have the pass manager >> support this so

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-13 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. In 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 >

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-13 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. If you compile file with -Ofast and use optimise(-Os) for F - I would expect no fast math flags for function F but I am worried a bit that only “optsize” is added. Plesse verify and/or add such test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D126984: [clang] Add support for optimize function attribute

2022-06-13 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:3469 +support the GCC semantics. Optimization levels `-O1` through `-O4` are +ignored. Only "-O0", "-Oz", "-Os", and "-Ofast" are supported. + something about `optimize(-Os)` still