[llvm] [AArch64][PAC] Lower jump-tables using hardened pseudo. (PR #97666)

Jon Roelofs via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 21:42:11 PDT 2024


================
@@ -3597,10 +3597,22 @@ bool AArch64InstructionSelector::selectBrJT(MachineInstr &I,
   unsigned JTI = I.getOperand(1).getIndex();
   Register Index = I.getOperand(2).getReg();
 
+  MF->getInfo<AArch64FunctionInfo>()->setJumpTableEntryInfo(JTI, 4, nullptr);
+  if (MF->getFunction().hasFnAttribute("jump-table-hardening") ||
+      STI.getTargetTriple().isArm64e()) {
+    if (TM.getCodeModel() != CodeModel::Small)
----------------
jroelofs wrote:

Do we also need one for `Tiny`? Not yet supported for Mach-O, but it would be a nasty surprise otherwise.

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


More information about the llvm-commits mailing list