[clang] [clang] Only set the trailing bytes to zero when filling a partially … (PR #79502)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 31 13:53:40 PST 2024


https://github.com/efriedma-quic commented:

It's not clear to me this is actually consistently profitable if the computed offset is small.  If we have to emit a memset starting at a weird offset, the code might get worse overall.  (e.g. on x86, a memset of 32 bytes is three instructions; a memset of 31 bytes is roughly 6.)  Not sure how much we should rely on the optimizer to fixup clean up cases like that.

We probably need to mess with the way emitStoresForInitAfterBZero handles padding... see #78034 .  (Not directly caused by your patch, but it closely interacts with the same code.)

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


More information about the cfe-commits mailing list