[clang] [llvm] [clang-tools-extra] Dont alter cold function alignment unless using Os (PR #72387)

Paul T Robinson via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 07:58:53 PST 2023


pogo59 wrote:

> We already have a way to set alignment: it's the "align" attribute.

Is clang aware of the target's default function alignment? I'd thought not, in which case deferring to LLVM (as this new attribute does) is correct. Happy to be corrected on this point.

> there isn't any obvious reason to special-case "cold" functions.

I'd thought that was clear. Cold implies opt-for-size, which implies align(1). We want cold not to imply align(1), directly or indirectly; but, if opt-for-size was requested explicitly, that should still imply align(1). The implied align(1) does interfere with a useful feature for PS4/PS5, and has for some time. If the tweak to the definition of "cold" should be specific to our targets, we can certainly do that.

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


More information about the llvm-commits mailing list