[llvm-branch-commits] [llvm] [AArch64][PAC] Move emission of LR checks in tail calls to AsmPrinter (PR #110705)

Daniil Kovalev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Oct 9 04:24:28 PDT 2024


================
@@ -107,6 +107,19 @@ unsigned AArch64InstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
   unsigned NumBytes = 0;
   const MCInstrDesc &Desc = MI.getDesc();
 
+  if (!MI.isBundle() && isTailCallReturnInst(MI)) {
+    NumBytes = Desc.getSize() ? Desc.getSize() : 4;
+
+    const auto *MFI = MF->getInfo<AArch64FunctionInfo>();
+    if (!MFI->shouldSignReturnAddress(MF))
+      return NumBytes;
+
+    auto &STI = MF->getSubtarget<AArch64Subtarget>();
----------------
kovdan01 wrote:

Nit
```suggestion
    const auto &STI = MF->getSubtarget<AArch64Subtarget>();
```

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


More information about the llvm-branch-commits mailing list