LLVM 24.0.0git
AArch64PointerAuth.cpp
Go to the documentation of this file.
1//===-- AArch64PointerAuth.cpp -- Harden code using PAuth ------------------==//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
11#include "AArch64.h"
13#include "AArch64InstrInfo.h"
15#include "AArch64Subtarget.h"
20
21using namespace llvm;
22using namespace llvm::AArch64PAuth;
23
24#define AARCH64_POINTER_AUTH_NAME "AArch64 Pointer Authentication"
25
26namespace {
27
28/// Control the emission of .cfi_set_ra_state, which replaces the
29/// deprecated .cfi_negate_ra_state_with_pc [1].
30///
31/// The latter is fundamentally unable to express some program orders [2], as
32/// the dwarf 'program' reads functions in a linear scan of their addresses to
33/// reconstruct the state of the frame, whereas control flow may enter and exit
34/// such regions arbitrarily (such as in hot-cold-split, and shrinkwrapped
35/// fucntions), and thus the negate-based cfi is unable to encode the address of
36/// the signing instruciton in all program orders.
37///
38/// Since .cfi_negate_ra_state is still sufficient for describing
39/// ptrauth-returns=pauth, we default to using the new CFI only for PAuth_LR, as
40/// DW_CFA_AARCH64_negate_ra_state has a smaller encoding than
41/// DW_CFA_AARCH64_set_ra_state.
42///
43/// 1: https://github.com/ARM-software/abi-aa/pull/346
44/// 2: https://github.com/ARM-software/abi-aa/issues/327
45enum class SetRAStateMode {
46 Never, // Always use .cfi_negate_ra_state(_with_pc)
47 PAuthLR, // Use .cfi_set_ra_state only for PAuth_LR
48 Always, // Use .cfi_set_ra_state for both PAuth and PAuth_LR
49};
50cl::opt<SetRAStateMode> CFILLVMSetRASignStateMode(
51 "aarch64-cfi-llvm-set-ra-sign-state", cl::init(SetRAStateMode::Never),
52 cl::desc("Control emission of .cfi_set_ra_state for PAC return address "
53 "signing CFI"),
54 cl::values(clEnumValN(SetRAStateMode::Never, "never",
55 "Always use legacy .cfi_negate_ra_state[_with_pc]"),
56 clEnumValN(SetRAStateMode::PAuthLR, "pauth-lr",
57 "Use new CFI only for PAuth_LR (default)"),
58 clEnumValN(SetRAStateMode::Always, "always",
59 "Use new CFI for both PAuth and PAuth_LR")),
61
62class AArch64PointerAuthImpl {
63public:
64 bool run(MachineFunction &MF);
65
66private:
67 const AArch64Subtarget *Subtarget = nullptr;
68 const AArch64InstrInfo *TII = nullptr;
69
70 void signLR(MachineFunction &MF, MachineBasicBlock::iterator MBBI) const;
71
72 void authenticateLR(MachineFunction &MF,
74};
75
76class AArch64PointerAuthLegacy : public MachineFunctionPass {
77public:
78 static char ID;
79
80 AArch64PointerAuthLegacy() : MachineFunctionPass(ID) {}
81
82 bool runOnMachineFunction(MachineFunction &MF) override;
83
84 StringRef getPassName() const override { return AARCH64_POINTER_AUTH_NAME; }
85};
86
87} // end anonymous namespace
88
89INITIALIZE_PASS(AArch64PointerAuthLegacy, "aarch64-ptrauth",
90 AARCH64_POINTER_AUTH_NAME, false, false)
91
93 return new AArch64PointerAuthLegacy();
94}
95
96char AArch64PointerAuthLegacy::ID = 0;
97
112
113// Wrap a given PAC instruction in CFI that describes it.
114//
115// Depending on the type of CFI required, we may need to emit the directive
116// either before or after the instruction, so that unwinders can correctly
117// interpret the location of the signing instruction.
118//
119// As a general rule, CFI opcodes describe the actions needed to recover the
120// register state leading up to a not-yet-retired instruction, with one
121// exception: .cfi_negate_ra_state_with_pc always comes before the paci[ab]sppc,
122// since the unwinder uses the location of the CFI itself to derive the address
123// of the signing instruction [1].
124// 1: https://github.com/llvm/llvm-project/pull/137795#issuecomment-2838779129
125template <typename BuildPACMIFn>
127 MachineBasicBlock::iterator MBBI, bool EmitCFI,
128 BuildPACMIFn BuildPACMI) {
129 if (!EmitCFI) {
130 BuildPACMI();
131 return;
132 }
133
134 auto &MF = *MBB.getParent();
135 auto &MFnI = *MF.getInfo<AArch64FunctionInfo>();
137 const Triple &TT = MF.getTarget().getTargetTriple();
138
139 if (MFnI.branchProtectionPAuthLR()) {
140 switch (CFILLVMSetRASignStateMode) {
141 case SetRAStateMode::Never:
142 CFIBuilder.buildNegateRAStateWithPC();
143 BuildPACMI();
144 break;
145 case SetRAStateMode::PAuthLR:
146 case SetRAStateMode::Always: {
147 BuildPACMI();
148 MCSymbol *PACSym = MFnI.getSigningInstrLabel();
149 assert(PACSym && "No PAC instruction to refer to");
150 CFIBuilder.buildSetRAState(2, PACSym);
151 break;
152 }
153 }
154 } else {
155 switch (CFILLVMSetRASignStateMode) {
156 case SetRAStateMode::Never:
157 case SetRAStateMode::PAuthLR:
158 BuildPACMI();
159 if (!TT.isOSBinFormatMachO()) {
160 CFIBuilder.buildNegateRAState();
161 }
162 break;
163 case SetRAStateMode::Always:
164 BuildPACMI();
165 CFIBuilder.buildSetRAState(1, nullptr);
166 break;
167 }
168 }
169}
170
172 bool EmitCFI) {
173 if (!EmitCFI)
174 return;
175
176 auto &MF = *MBB.getParent();
177 auto &MFnI = *MF.getInfo<AArch64FunctionInfo>();
179 const Triple &TT = MF.getTarget().getTargetTriple();
180
181 if (MFnI.branchProtectionPAuthLR()) {
182 switch (CFILLVMSetRASignStateMode) {
183 case SetRAStateMode::Never:
184 // DW_CFA_AARCH64_negate_ra_state_with_pc is semantically broken for
185 // functions where shrinkwrapping places signing/authenticating pairs on
186 // distinct CFG paths.
187 //
188 // DWARF CFI is evaluated linearly over the byte stream, not along control
189 // flow edges. The toggle semantics of this directive therefore cannot
190 // faithfully represent the signed/unsigned RA state for all possible CFG
191 // paths. The added complexity versus DW_CFA_AARCH64_negate_ra_state is
192 // that an unwinder must also reconstruct the PC of the PACI[AB]SPPC in
193 // order to verify the signed LR, and that address is derived from the
194 // location of this directive in the linear CFI stream.
195 //
196 // The correct fix is to use DW_CFA_AARCH64_set_ra_state_with_pc, which
197 // sets the RA state and signing address absolutely rather than toggling
198 // them. An unwinder that supports this directive can reconstruct the
199 // correct state on any CFG path, regardless of how many
200 // signing/authenticating pairs exist in the function. However, not all
201 // unwinders support this directive, so we cannot rely on it exclusively.
202 //
203 // For unwinders that only support DW_CFA_AARCH64_negate_ra_state_with_pc,
204 // libunwind exploits a loophole: it records the address at the
205 // DW_CFA_AARCH64_negate_ra_state_with_pc site to authenticate the LR, but
206 // does not care that the CFI state remains "signed with pc" after
207 // authentication has occurred. This means we can safely omit the
208 // FrameDestroy emission of this directive, treating it solely as a marker
209 // for the signing site, as long as each function has at most one such
210 // signing location. That invariant holds today because shrinkwrapping
211 // does not yet hoist or sink PAuth_LR frame code across CFG join/split
212 // points; once it does, we must avoid those transformations on platforms
213 // that have this limitation.
214 //
215 // https://github.com/ARM-software/abi-aa/issues/327
216 // https://github.com/ARM-software/abi-aa/pull/346
217 break;
218 case SetRAStateMode::PAuthLR:
219 case SetRAStateMode::Always:
220 CFIBuilder.buildSetRAState(0, nullptr);
221 break;
222 }
223 } else if (!TT.isOSBinFormatMachO()) {
224 switch (CFILLVMSetRASignStateMode) {
225 case SetRAStateMode::Never:
226 case SetRAStateMode::PAuthLR:
227 CFIBuilder.buildNegateRAState();
228 break;
229 case SetRAStateMode::Always:
230 CFIBuilder.buildSetRAState(0, nullptr);
231 break;
232 }
233 }
234}
235
236void AArch64PointerAuthImpl::signLR(MachineFunction &MF,
238 auto &MFnI = *MF.getInfo<AArch64FunctionInfo>();
239 bool UseBKey = MFnI.shouldSignWithBKey();
240 bool EmitCFI = MFnI.needsDwarfUnwindInfo(MF);
241 bool NeedsWinCFI = MF.hasWinCFI();
242
243 MachineBasicBlock &MBB = *MBBI->getParent();
244
245 // Debug location must be unknown, see AArch64FrameLowering::emitPrologue.
246 DebugLoc DL;
247
248 if (UseBKey && !MF.getTarget().getTargetTriple().isOSBinFormatMachO()) {
249 BuildMI(MBB, MBBI, DL, TII->get(AArch64::EMITBKEY))
251 }
252
253 // PAuthLR authentication instructions need to know the value of PC at the
254 // point of signing (PACI*).
255 if (MFnI.branchProtectionPAuthLR()) {
256 MCSymbol *PACSym = MF.getContext().createTempSymbol();
257 MFnI.setSigningInstrLabel(PACSym);
258 }
259
260 // No SEH opcode for this one; it doesn't materialize into an
261 // instruction on Windows.
262 if (MFnI.branchProtectionPAuthLR() && Subtarget->hasPAuthLR()) {
263 decoratePACWithCFI(MBB, MBBI, EmitCFI, [&]() {
264 BuildMI(MBB, MBBI, DL,
265 TII->get(UseBKey ? AArch64::PACIBSPPC : AArch64::PACIASPPC))
267 ->setPreInstrSymbol(MF, MFnI.getSigningInstrLabel());
268 });
269 } else {
270 if (MFnI.branchProtectionPAuthLR()) {
271 BuildMI(MBB, MBBI, DL, TII->get(AArch64::PACM))
273 }
274 decoratePACWithCFI(MBB, MBBI, EmitCFI, [&]() {
275 BuildMI(MBB, MBBI, DL,
276 TII->get(UseBKey ? AArch64::PACIBSP : AArch64::PACIASP))
278 ->setPreInstrSymbol(MF, MFnI.getSigningInstrLabel());
279 });
280 }
281
282 if (!EmitCFI && NeedsWinCFI) {
283 assert(UseBKey &&
284 "Windows SEH PAC unwind info only supports B-key signing");
285 BuildMI(MBB, MBBI, DL, TII->get(AArch64::SEH_PACSignLR))
287 }
288}
289
290void AArch64PointerAuthImpl::authenticateLR(
291 MachineFunction &MF, MachineBasicBlock::iterator MBBI) const {
292 const AArch64FunctionInfo *MFnI = MF.getInfo<AArch64FunctionInfo>();
293 bool UseBKey = MFnI->shouldSignWithBKey();
294 bool EmitAsyncCFI = MFnI->needsAsyncDwarfUnwindInfo(MF);
295 bool NeedsWinCFI = MF.hasWinCFI();
296
297 MachineBasicBlock &MBB = *MBBI->getParent();
298 DebugLoc DL = MBBI->getDebugLoc();
299 // MBBI points to a PAUTH_EPILOGUE instruction to be replaced and
300 // TI points to a terminator instruction that may or may not be combined.
301 // Note that inserting new instructions "before MBBI" and "before TI" is
302 // not the same because if ShadowCallStack is enabled, its instructions
303 // are placed between MBBI and TI.
305
306 // The AUTIASP instruction assembles to a hint instruction before v8.3a so
307 // this instruction can safely used for any v8a architecture.
308 // From v8.3a onwards there are optimised authenticate LR and return
309 // instructions, namely RETA{A,B}, that can be used instead. In this case the
310 // DW_CFA_AARCH64_negate_ra_state can't be emitted.
311 bool TerminatorIsCombinable =
312 TI != MBB.end() && TI->getOpcode() == AArch64::RET;
313 MCSymbol *PACSym = MFnI->getSigningInstrLabel();
314
315 if (Subtarget->hasPAuth() && TerminatorIsCombinable && !NeedsWinCFI &&
316 !MF.getFunction().hasFnAttribute(Attribute::ShadowCallStack)) {
317 if (MFnI->branchProtectionPAuthLR() && Subtarget->hasPAuthLR()) {
318 assert(PACSym && "No PAC instruction to refer to");
319 BuildMI(MBB, TI, DL,
320 TII->get(UseBKey ? AArch64::RETABSPPCi : AArch64::RETAASPPCi))
321 .addSym(PACSym)
324 } else {
325 if (MFnI->branchProtectionPAuthLR()) {
327 AArch64::X16);
328 BuildMI(MBB, MBBI, DL, TII->get(AArch64::PACM))
330 }
331 BuildMI(MBB, TI, DL, TII->get(UseBKey ? AArch64::RETAB : AArch64::RETAA))
334 }
335 MBB.erase(TI);
336 return;
337 }
338
339 auto &AFL = *static_cast<const AArch64FrameLowering *>(
340 MF.getSubtarget().getFrameLowering());
341 int64_t ArgumentStackToRestore = AFL.getArgumentStackToRestore(MF, MBB);
342
343 // When ArgumentStackToRestore < 0, the tail callee pops more argument space
344 // than this function received, so after the frame teardown SP is below the
345 // entry SP used as the signing modifier. Reconstruct entry SP in x16 and
346 // authenticate using AUTI[AB]1716 (x17=LR, x16=entry_SP).
347 if (ArgumentStackToRestore < 0) {
348 emitFrameOffset(MBB, MBBI, DL, AArch64::X16, AArch64::SP,
349 StackOffset::getFixed(-ArgumentStackToRestore), TII,
351
352 BuildMI(MBB, MBBI, DL, TII->get(AArch64::ORRXrs), AArch64::X17)
353 .addReg(AArch64::XZR)
354 .addReg(AArch64::LR)
355 .addImm(0)
357
358 if (MFnI->branchProtectionPAuthLR() && Subtarget->hasPAuthLR()) {
359 assert(PACSym && "No PAC instruction to refer to");
361 AArch64::X15);
362
363 emitAUTCFI(MBB, MBBI, EmitAsyncCFI);
364 unsigned AutOpc = UseBKey ? AArch64::AUTIB171615 : AArch64::AUTIA171615;
365 BuildMI(MBB, MBBI, DL, TII->get(AutOpc))
367 } else if (MFnI->branchProtectionPAuthLR()) {
368 assert(PACSym && "No PAC instruction to refer to");
370 AArch64::X15);
371
372 // The PACM hint-space instruction modifies the following AUTI[AB]1716
373 // to optionally take x15 as an extra operand depending on the
374 // presence of +pauth-lr at runtime. On machines without +pauth-lr, it
375 // behaves as a nop, and the address of the PACI[AB]SP in x15 is
376 // ignored.
377 BuildMI(MBB, MBBI, DL, TII->get(AArch64::PACM))
379
380 emitAUTCFI(MBB, MBBI, EmitAsyncCFI);
381 unsigned AutOpc = UseBKey ? AArch64::AUTIB1716 : AArch64::AUTIA1716;
382 BuildMI(MBB, MBBI, DL, TII->get(AutOpc))
384 } else {
385 unsigned AutOpc = UseBKey ? AArch64::AUTIB1716 : AArch64::AUTIA1716;
386 BuildMI(MBB, MBBI, DL, TII->get(AutOpc))
388 emitAUTCFI(MBB, MBBI, EmitAsyncCFI);
389 }
390
391 BuildMI(MBB, MBBI, DL, TII->get(AArch64::ORRXrs), AArch64::LR)
392 .addReg(AArch64::XZR)
393 .addReg(AArch64::X17)
394 .addImm(0)
396 return;
397 }
398
399 // When ArgumentStackToRestore > 0, this function received more argument
400 // space than the tail callee pops. The epilogue contains an SP adjustment
401 // (e.g. "add sp, sp, #N") to discard the leftover argument space. We must
402 // authenticate *before* that adjustment so that AUTI[AB]SP sees the entry
403 // SP discriminator. Move any such SP-adjusting instructions to after the
404 // authentication instruction.
405 //
406 // We cannot simply bump SP first and then use AUTI[AB]SP with the bumped
407 // value, because the live arguments would fall below SP and potentially
408 // outside the red-zone.
409 SmallVector<MachineInstr *, 2> SPMods;
410 if (ArgumentStackToRestore > 0) {
411 for (auto I = MBBI; I->getFlag(MachineInstr::FrameDestroy); --I) {
412 if ((I->getOpcode() == AArch64::ADDXri ||
413 I->getOpcode() == AArch64::SUBXri) &&
414 I->getOperand(0).getReg() == AArch64::SP &&
415 I->getOperand(1).getReg() == AArch64::SP)
416 SPMods.push_back(&*I);
417 }
418 }
419 for (auto *MI : SPMods)
420 MI->removeFromParent();
421
422 if (MFnI->branchProtectionPAuthLR() && Subtarget->hasPAuthLR()) {
423 assert(PACSym && "No PAC instruction to refer to");
424 emitAUTCFI(MBB, MBBI, EmitAsyncCFI);
425 BuildMI(MBB, MBBI, DL,
426 TII->get(UseBKey ? AArch64::AUTIBSPPCi : AArch64::AUTIASPPCi))
427 .addSym(PACSym)
429 } else {
430 if (MFnI->branchProtectionPAuthLR()) {
432 AArch64::X16);
433
434 BuildMI(MBB, MBBI, DL, TII->get(AArch64::PACM))
436 emitAUTCFI(MBB, MBBI, EmitAsyncCFI);
437 }
438 BuildMI(MBB, MBBI, DL,
439 TII->get(UseBKey ? AArch64::AUTIBSP : AArch64::AUTIASP))
441 if (!MFnI->branchProtectionPAuthLR())
442 emitAUTCFI(MBB, MBBI, EmitAsyncCFI);
443 }
444
445 if (NeedsWinCFI) {
446 assert(UseBKey &&
447 "Windows SEH PAC unwind info only supports B-key signing");
448 BuildMI(MBB, MBBI, DL, TII->get(AArch64::SEH_PACSignLR))
450 }
451
452 for (auto *MI : SPMods)
453 MBB.insert(MBBI, MI);
454}
455
457 switch (Method) {
459 return 0;
461 return 4;
463 return 12;
466 return 20;
467 }
468 llvm_unreachable("Unknown AuthCheckMethod enum");
469}
470
471bool AArch64PointerAuthImpl::run(MachineFunction &MF) {
472 Subtarget = &MF.getSubtarget<AArch64Subtarget>();
473 TII = Subtarget->getInstrInfo();
474
476
477 bool Modified = false;
478
479 for (auto &MBB : MF) {
480 for (auto &MI : MBB) {
481 switch (MI.getOpcode()) {
482 default:
483 break;
484 case AArch64::PAUTH_PROLOGUE:
485 case AArch64::PAUTH_EPILOGUE:
486 PAuthPseudoInstrs.push_back(MI.getIterator());
487 break;
488 }
489 }
490 }
491
492 for (auto It : PAuthPseudoInstrs) {
493 switch (It->getOpcode()) {
494 case AArch64::PAUTH_PROLOGUE:
495 signLR(MF, It);
496 break;
497 case AArch64::PAUTH_EPILOGUE:
498 authenticateLR(MF, It);
499 break;
500 default:
501 llvm_unreachable("Unhandled opcode");
502 }
503 It->eraseFromParent();
504 Modified = true;
505 }
506
507 return Modified;
508}
509
510bool AArch64PointerAuthLegacy::runOnMachineFunction(MachineFunction &MF) {
511 return AArch64PointerAuthImpl().run(MF);
512}
513
514PreservedAnalyses
517 const bool Changed = AArch64PointerAuthImpl().run(MF);
518 if (!Changed)
519 return PreservedAnalyses::all();
522 return PA;
523}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define AARCH64_POINTER_AUTH_NAME
static void emitEpiloguePACSymOffsetIntoReg(const TargetInstrInfo &TII, MachineBasicBlock &MBB, MachineBasicBlock::iterator I, DebugLoc DL, MCSymbol *PACSym, Register Reg)
static void emitAUTCFI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, bool EmitCFI)
static void decoratePACWithCFI(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, bool EmitCFI, BuildPACMIFn BuildPACMI)
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
const HexagonInstrInfo * TII
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition MD5.cpp:57
Register Reg
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Definition PassSupport.h:56
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
bool needsAsyncDwarfUnwindInfo(const MachineFunction &MF) const
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
const AArch64InstrInfo * getInstrInfo() const override
Represents analyses that only rely on functions' control flow.
Definition Analysis.h:73
Helper class for creating CFI instructions and inserting them into MIR.
A debug info location.
Definition DebugLoc.h:126
FunctionPass class - This class is used to implement most global optimizations.
Definition Pass.h:314
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition Function.cpp:723
LLVM_ABI MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
LLVM_ABI instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
LLVM_ABI instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
LLVM_ABI instr_iterator getFirstInstrTerminator()
Same getFirstTerminator but it ignores bundles and return an instr_iterator instead.
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MCContext & getContext() const
Function & getFunction()
Return the LLVM function that this machine code represents.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
const MachineInstrBuilder & setMIFlag(MachineInstr::MIFlag Flag) const
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addSym(MCSymbol *Sym, unsigned char TargetFlags=0) const
const MachineInstrBuilder & copyImplicitOps(const MachineInstr &OtherMI) const
Copy all the implicit operands from OtherMI onto this one.
LLVM_ABI void setPreInstrSymbol(MachineFunction &MF, MCSymbol *Symbol)
Set a symbol that will be emitted just prior to the instruction itself.
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition Analysis.h:118
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
Definition Analysis.h:151
Wrapper class representing virtual and physical registers.
Definition Register.h:20
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
int64_t getFixed() const
Returns the fixed component of the stack.
Definition TypeSize.h:46
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
TargetInstrInfo - Interface to description of machine instruction set.
const Triple & getTargetTriple() const
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
Definition Triple.h:873
Changed
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ MO_NC
MO_NC - Indicates whether the linker is expected to check the symbol reference for overflow.
@ MO_PAGEOFF
MO_PAGEOFF - A symbol operand with this flag represents the offset of that symbol within a 4K page.
@ MO_PAGE
MO_PAGE - A symbol operand with this flag represents the pc-relative offset of the 4K page containing...
unsigned getCheckerSizeInBytes(AuthCheckMethod Method)
Returns the number of bytes added by checkAuthenticatedRegister.
AuthCheckMethod
Variants of check performed on an authenticated pointer.
@ XPACHint
Check by comparing the authenticated value with an XPAC-ed one without using PAuth instructions not e...
@ DummyLoad
Perform a load to a temporary register.
@ HighBitsNoTBI
Check by comparing bits 62 and 61 of the authenticated address.
@ None
Do not check the value at all.
@ XPAC
Similar to XPACHint but using Armv8.3-only XPAC instruction, thus not restricted to LR:
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
FunctionPass * createAArch64PointerAuthPass()
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
void emitFrameOffset(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, StackOffset Offset, const TargetInstrInfo *TII, MachineInstr::MIFlag=MachineInstr::NoFlags, bool SetNZCV=false, bool NeedsWinCFI=false, bool *HasWinCFI=nullptr, bool EmitCFAOffset=false, StackOffset InitialOffset={}, unsigned FrameReg=AArch64::SP)
emitFrameOffset - Emit instructions as needed to set DestReg to SrcReg plus Offset.
@ Always
Always emit .debug_str_offsets talbes as DWARF64 for testing.
Definition DWP.h:32