[llvm] [AArch64][PAC] Lower jump-tables using hardened pseudo. (PR #97666)
Daniil Kovalev via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 7 23:52:58 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:
I agree that if we check against `Small`, we might also want to check against `Tiny`. I'm actually not sure if such a check is essential here at all - see https://github.com/llvm/llvm-project/pull/97666#discussion_r1668053989
https://github.com/llvm/llvm-project/pull/97666
More information about the llvm-commits
mailing list