[clang] [clang-tools-extra] [llvm] [MTE] Apply alignment / size in AsmPrinter rather than IR (PR #111918)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 11 13:41:57 PST 2024


https://github.com/arichardson commented:

I had to do something very similar for CHERI downstream: We have to ensure that all globals are precisely representable (which may require rounding up the size+alignment) so you don't end up creating bounds that include adjacent ones.
The original patch from 2019 is here: https://github.com/CTSRD-CHERI/llvm-project/commit/fd224dddafefbed3b068a0afc1a242bf8eb65d20

I wonder if it would be possible have a hook that CHERI can reuse downstream: something like: `getRequiredGlobalAlignment()` and `getRequiredGlobalSize()`. For MTE this could return 16 for alignment and round the size up to a multiple of 16 and after the next merge the CHERI downstream could reuse those hooks.

Adding @jrtc27 for visibility.

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


More information about the llvm-commits mailing list