[PATCH] D99417: [AArch64][v8.5A] Add BTI to all function starts

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 30 06:16:49 PDT 2021


peter.smith added a comment.

In D99417#2658168 <https://reviews.llvm.org/D99417#2658168>, @pbarrio wrote:

> In D99417#2653048 <https://reviews.llvm.org/D99417#2653048>, @peter.smith wrote:
>
>> My guess is that this would only affect a small number of functions?
>
> I got some numbers on the NDK samples (https://github.com/android/ndk-samples). Of a total of 6746 functions, this patch inserts a landing pad for 22 additional functions, which is ~0.3% of them. I haven't done proper benchmarking since this is a bugfix rather than an optimization, but I agree that this patch should affect a small number of functions.

Thanks for the figures, that looks like we avoid a potential problem without much impact on the generated code.

For patchable functions are there any other cases where we wouldn't generate a BTI at the start of the function? If there is we may be alter the test so that it is still checking that the nop is still inserted. If there is no way to avoid a BTI then we may have to alter the expected result and the comment.

I've dug up https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424 and https://reviews.llvm.org/D72215 for context.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99417/new/

https://reviews.llvm.org/D99417



More information about the llvm-commits mailing list