[llvm] [BOLT][AArch64] Support for pointer authentication (v2) (PR #120064)
Gergely Bálint via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 10 05:46:23 PST 2025
bgergely0 wrote:
Thanks for the feedback @kbeyls!
## Doc
I agree that storing an in-depth description would be nice. I added comments to key parts, so the sources contain a more concise description of the problem/solution, but these are scattered in different files.
## MCAnnotations
I'm not sure how a single annotation would work. As the MCAnnotation is essentially an `enum`, I cannot represent the different states by one enum element.
As far as I know (and backed up by https://godbolt.org/z/fv87j3vod ) even though the 4 element enum could be described in 2 bits, a `color` option takes up 4 bytes. So I think we have plenty of space for adding new MCAnnotation options.
The runtime memory footprint would increase a bit, because in MarkRAState Pass, the state of each instruction is annotated, so an extra annotation is stored on each MCInst, but according to my bytehound measurements, it increases the memory by less than 3%. And this only applies in the case of `pac-ret` binaries, which were not supported before, so the comparison is not very meaningful. And because the size of an MCAnnotation does not increase, users running BOLT on non `pac-ret` binaries would not see a difference in runtime memory consumption.
Thanks for pointing this out though, I just realized I left the `kUnknownSign` in, which is not used at all.
https://github.com/llvm/llvm-project/pull/120064
More information about the llvm-commits
mailing list