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

Jon Roelofs via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 14:04:42 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:

I misread. This is already asserting that only `Small` is supported. Support for other models can come in a later patch as needed.

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


More information about the llvm-commits mailing list