diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index 3ca851ef83d27..9d805dad07c1c 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -151,7 +151,8 @@ unsigned AArch64InstrInfo::getInstSizeInBytes(const MachineInstr &MI) const { const MCInstrDesc &Desc = MI.getDesc(); // LFI rewriter expansions that supersede normal sizing. - if (Subtarget.isLFI()) + const auto &STI = MF->getSubtarget(); + if (STI.isLFI()) if (auto Size = getLFIInstSizeInBytes(MI)) return *Size; @@ -162,7 +163,6 @@ unsigned AArch64InstrInfo::getInstSizeInBytes(const MachineInstr &MI) const { if (!MFI->shouldSignReturnAddress(*MF)) return NumBytes; - const auto &STI = MF->getSubtarget(); auto Method = STI.getAuthenticatedLRCheckMethod(*MF); NumBytes += AArch64PAuth::getCheckerSizeInBytes(Method); return NumBytes;