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

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 03:55:43 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)
----------------
kovdan01 wrote:

Alternatively, I think it would be OK to explicitly not support large code model at all (both in SDAG/GISel) in context of this PR, and add such support separately to have main logic for the most common use case already merged.

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


More information about the llvm-commits mailing list