[PATCH] D126984: [clang] Add initial support for gcc's optimize function attribute

Stephen Long via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 11:14:42 PDT 2022


steplong added a comment.

>> and even for the MSVC pragma `#pragma optimize("t", on)`, what are we supporting if the user compiles their code with `-O0`? because right now we won't optimize anything with `-O0`
>
> @steplong -- what are your thoughts on this?

Hmm, I think I'm ok with ignoring the pragma when "-O0". In the case of "t", at the moment, we are just going to honor whatever is passed on the commandline. I think with what the patch looks like now, we'll be supporting the pragma optimize like:

| Parameter | On                   | Off                                        |
| --------- | -------------------- |                                            |
| g         | Deprecated           | Deprecated                                 |
| s         | Add OptimizeAttr::Os | Add Optnone (Not sure if this makes sense) |
| t         | Do nothing           | Add Optnone                                |
| y         | Do nothing           | Do nothing                                 |


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