[clang] [llvm] [AArch64][PAC] Sign block addresses used in indirectbr. (PR #97647)
Daniil Kovalev via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 8 03:50:28 PDT 2024
================
@@ -3461,6 +3470,23 @@ bool AArch64InstructionSelector::select(MachineInstr &I) {
return true;
}
case TargetOpcode::G_BLOCK_ADDR: {
+ Function *BAFn = I.getOperand(1).getBlockAddress()->getFunction();
+ if (std::optional<uint16_t> BADisc =
+ STI.getPtrAuthBlockAddressDiscriminator(*BAFn)) {
+ MIB.buildInstr(TargetOpcode::IMPLICIT_DEF, {AArch64::X16}, {});
----------------
kovdan01 wrote:
Is there a test which covers this code path?
https://github.com/llvm/llvm-project/pull/97647
More information about the llvm-commits
mailing list