[PATCH] D129693: [ARM] Don't emit Arm speculation hardening thunks under Thumb and vice-versa

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 03:17:25 PST 2022


dmgreen added inline comments.


================
Comment at: llvm/test/CodeGen/ARM/speculation-hardening-sls-boththunks.ll:4
+; Given both Arm and THumb functions in the same compilation unit, we should
+; get both arm and thumb thunks.
+
----------------
DavidSpickett wrote:
> Is there reason to check that with only one of arm and thumb you only get thunks for that one?
The idea is that we should be checking that if we emitting instructions which require a target feature, that target feature should be present. Think of things like accidentally emitting NEON instructions when compiling for MVE, or emitting SVE2 instructions when you only have SVE. So we can't emit Thumb instructions if the target is for Arm. (Without constructing a subtarget with Thumb present).

If you search for "verifyInstructionPredicates", you will see that most architectures have this check enabled, but Arm has always been missing. That is what I am attempting to fix. Improving how much we test emitted instruction features by enabling the option for Arm.

In this case, as far as I understand, If we are in a Arm context then we will only need arm thunks. And Thumb will only ever use thumb thunks. This tests makes sure that in a module with both, we still end up with both sets of thunks.


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

https://reviews.llvm.org/D129693



More information about the llvm-commits mailing list