[clang] [llvm] [IR][IPO] Don't rewrite the signature of optnone functions (PR #211804)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 9 12:05:16 PDT 2026


jhuber6 wrote:

I made some changes, as I did not like the previous solution after thinking on it. We still want `optnone` functions to participate in IPO optimizations, but we only want to prevent its signature from being rewritten. Being more strict about this had a lot of collateral damage that I believe was against the intention behind keeping `optnone` and `noipa` separate.

Currently, we already opt out using the `naked` attribute as it wants the same thing, to avoid changing the function. I think this is comprehensive enough by putting it in a helper function, but if we need something more strict I can do that. I think that this is more in-line with that users expect `optnone` to do, i.e. not touch the function at all.

PTAL.

https://github.com/llvm/llvm-project/pull/211804


More information about the cfe-commits mailing list