LLVM 22.0.0git
AArch64Subtarget.cpp
Go to the documentation of this file.
1//===-- AArch64Subtarget.cpp - AArch64 Subtarget Information ----*- C++ -*-===//
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//
9// This file implements the AArch64 specific subclass of TargetSubtarget.
10//
11//===----------------------------------------------------------------------===//
12
13#include "AArch64Subtarget.h"
14
15#include "AArch64.h"
16#include "AArch64InstrInfo.h"
17#include "AArch64PBQPRegAlloc.h"
26#include "llvm/IR/GlobalValue.h"
29
30using namespace llvm;
31
32#define DEBUG_TYPE "aarch64-subtarget"
33
34#define GET_SUBTARGETINFO_CTOR
35#define GET_SUBTARGETINFO_TARGET_DESC
36#include "AArch64GenSubtargetInfo.inc"
37
38static cl::opt<bool>
39EnableEarlyIfConvert("aarch64-early-ifcvt", cl::desc("Enable the early if "
40 "converter pass"), cl::init(true), cl::Hidden);
41
42// If OS supports TBI, use this flag to enable it.
43static cl::opt<bool>
44UseAddressTopByteIgnored("aarch64-use-tbi", cl::desc("Assume that top byte of "
45 "an address is ignored"), cl::init(false), cl::Hidden);
46
48 "aarch64-macho-enable-nonlazybind",
49 cl::desc("Call nonlazybind functions via direct GOT load for Mach-O"),
51
52static cl::opt<bool> UseAA("aarch64-use-aa", cl::init(true),
53 cl::desc("Enable the use of AA during codegen."));
54
56 "aarch64-insert-extract-base-cost",
57 cl::desc("Base cost of vector insert/extract element"), cl::Hidden);
58
59// Reserve a list of X# registers, so they are unavailable for register
60// allocator, but can still be used as ABI requests, such as passing arguments
61// to function call.
63ReservedRegsForRA("reserve-regs-for-regalloc", cl::desc("Reserve physical "
64 "registers, so they can't be used by register allocator. "
65 "Should only be used for testing register allocator."),
67
69 AuthenticatedLRCheckMethod("aarch64-authenticated-lr-check-method",
71 cl::desc("Override the variant of check applied "
72 "to authenticated LR during tail call"),
74
76 "aarch64-min-jump-table-entries", cl::init(10), cl::Hidden,
77 cl::desc("Set minimum number of entries to use a jump table on AArch64"));
78
80 "aarch64-streaming-hazard-size",
81 cl::desc("Hazard size for streaming mode memory accesses. 0 = disabled."),
83
85 "aarch64-stack-hazard-size",
86 cl::desc("alias for -aarch64-streaming-hazard-size"),
88
90 "aarch64-enable-zpr-predicate-spills", cl::init(false), cl::Hidden,
92 "Enables spilling/reloading SVE predicates as data vectors (ZPRs)"));
93
94// Subreg liveness tracking is disabled by default for now until all issues
95// are ironed out. This option allows the feature to be used in tests.
96static cl::opt<bool>
97 EnableSubregLivenessTracking("aarch64-enable-subreg-liveness-tracking",
98 cl::init(false), cl::Hidden,
99 cl::desc("Enable subreg liveness tracking"));
100
101static cl::opt<bool>
102 UseScalarIncVL("sve-use-scalar-inc-vl", cl::init(false), cl::Hidden,
103 cl::desc("Prefer add+cnt over addvl/inc/dec"));
104
106 if (OverrideVectorInsertExtractBaseCost.getNumOccurrences() > 0)
109}
110
111AArch64Subtarget &AArch64Subtarget::initializeSubtargetDependencies(
112 StringRef FS, StringRef CPUString, StringRef TuneCPUString,
113 bool HasMinSize) {
114 // Determine default and user-specified characteristics
115
116 if (CPUString.empty())
117 CPUString = "generic";
118
119 if (TuneCPUString.empty())
120 TuneCPUString = CPUString;
121
122 ParseSubtargetFeatures(CPUString, TuneCPUString, FS);
123 initializeProperties(HasMinSize);
124
125 return *this;
126}
127
128void AArch64Subtarget::initializeProperties(bool HasMinSize) {
129 // Initialize CPU specific properties. We should add a tablegen feature for
130 // this in the future so we can specify it together with the subtarget
131 // features.
132 switch (ARMProcFamily) {
133 case Generic:
134 // Using TuneCPU=generic we avoid ldapur instructions to line up with the
135 // cpus that use the AvoidLDAPUR feature. We don't want this to be on
136 // forever, so it is enabled between armv8.4 and armv8.7/armv9.2.
137 if (hasV8_4aOps() && !hasV8_8aOps())
138 AvoidLDAPUR = true;
139 break;
140 case Carmel:
141 CacheLineSize = 64;
142 break;
143 case CortexA35:
144 case CortexA53:
145 case CortexA55:
146 case CortexR82:
147 case CortexR82AE:
151 break;
152 case CortexA57:
157 break;
158 case CortexA65:
160 break;
161 case CortexA72:
162 case CortexA73:
163 case CortexA75:
167 break;
168 case CortexA76:
169 case CortexA77:
170 case CortexA78:
171 case CortexA78AE:
172 case CortexA78C:
173 case CortexX1:
177 break;
178 case CortexA320:
179 case CortexA510:
180 case CortexA520:
182 VScaleForTuning = 1;
185 break;
186 case CortexA710:
187 case CortexA715:
188 case CortexA720:
189 case CortexA725:
190 case CortexX2:
191 case CortexX3:
192 case CortexX4:
193 case CortexX925:
195 VScaleForTuning = 1;
198 break;
199 case A64FX:
200 CacheLineSize = 256;
204 PrefetchDistance = 128;
205 MinPrefetchStride = 1024;
207 VScaleForTuning = 4;
208 break;
209 case MONAKA:
210 VScaleForTuning = 2;
211 break;
212 case AppleA7:
213 case AppleA10:
214 case AppleA11:
215 case AppleA12:
216 case AppleA13:
217 case AppleA14:
218 case AppleA15:
219 case AppleA16:
220 case AppleA17:
221 case AppleM4:
222 CacheLineSize = 64;
223 PrefetchDistance = 280;
224 MinPrefetchStride = 2048;
226 switch (ARMProcFamily) {
227 case AppleA14:
228 case AppleA15:
229 case AppleA16:
230 case AppleA17:
231 case AppleM4:
233 break;
234 default:
235 break;
236 }
237 break;
238 case ExynosM3:
240 MaxJumpTableSize = 20;
243 break;
244 case Falkor:
246 // FIXME: remove this to enable 64-bit SLP if performance looks good.
248 CacheLineSize = 128;
249 PrefetchDistance = 820;
250 MinPrefetchStride = 2048;
252 break;
253 case Kryo:
256 CacheLineSize = 128;
257 PrefetchDistance = 740;
258 MinPrefetchStride = 1024;
260 // FIXME: remove this to enable 64-bit SLP if performance looks good.
262 break;
263 case NeoverseE1:
265 break;
266 case NeoverseN1:
270 break;
271 case NeoverseV2:
272 case NeoverseV3:
273 CacheLineSize = 64;
276 ScatterOverhead = 13;
278 case NeoverseN2:
279 case NeoverseN3:
283 VScaleForTuning = 1;
284 break;
285 case NeoverseV1:
289 VScaleForTuning = 2;
291 break;
292 case Neoverse512TVB:
294 VScaleForTuning = 1;
296 break;
297 case Saphira:
299 // FIXME: remove this to enable 64-bit SLP if performance looks good.
301 break;
302 case ThunderX2T99:
303 CacheLineSize = 64;
307 PrefetchDistance = 128;
308 MinPrefetchStride = 1024;
310 // FIXME: remove this to enable 64-bit SLP if performance looks good.
312 break;
313 case ThunderX:
314 case ThunderXT88:
315 case ThunderXT81:
316 case ThunderXT83:
317 CacheLineSize = 128;
320 // FIXME: remove this to enable 64-bit SLP if performance looks good.
322 break;
323 case TSV110:
324 CacheLineSize = 64;
327 break;
328 case ThunderX3T110:
329 CacheLineSize = 64;
333 PrefetchDistance = 128;
334 MinPrefetchStride = 1024;
336 // FIXME: remove this to enable 64-bit SLP if performance looks good.
338 break;
339 case Ampere1:
340 case Ampere1A:
341 case Ampere1B:
342 CacheLineSize = 64;
346 break;
347 case Oryon:
348 CacheLineSize = 64;
351 PrefetchDistance = 128;
352 MinPrefetchStride = 1024;
353 break;
354 case Olympus:
357 ScatterOverhead = 13;
361 VScaleForTuning = 1;
362 break;
363 }
364
365 if (AArch64MinimumJumpTableEntries.getNumOccurrences() > 0 || !HasMinSize)
367}
368
370 StringRef TuneCPU, StringRef FS,
371 const TargetMachine &TM, bool LittleEndian,
372 unsigned MinSVEVectorSizeInBitsOverride,
373 unsigned MaxSVEVectorSizeInBitsOverride,
374 bool IsStreaming, bool IsStreamingCompatible,
375 bool HasMinSize)
376 : AArch64GenSubtargetInfo(TT, CPU, TuneCPU, FS),
377 ReserveXRegister(AArch64::GPR64commonRegClass.getNumRegs()),
378 ReserveXRegisterForRA(AArch64::GPR64commonRegClass.getNumRegs()),
379 CustomCallSavedXRegs(AArch64::GPR64commonRegClass.getNumRegs()),
380 IsLittle(LittleEndian), IsStreaming(IsStreaming),
381 IsStreamingCompatible(IsStreamingCompatible),
382 StreamingHazardSize(
383 AArch64StreamingHazardSize.getNumOccurrences() > 0
385 : std::nullopt),
386 MinSVEVectorSizeInBits(MinSVEVectorSizeInBitsOverride),
387 MaxSVEVectorSizeInBits(MaxSVEVectorSizeInBitsOverride), TargetTriple(TT),
388 InstrInfo(initializeSubtargetDependencies(FS, CPU, TuneCPU, HasMinSize)),
389 TLInfo(TM, *this) {
392
395 Legalizer.reset(new AArch64LegalizerInfo(*this));
396
397 auto *RBI = new AArch64RegisterBankInfo(*getRegisterInfo());
398
399 // FIXME: At this point, we can't rely on Subtarget having RBI.
400 // It's awkward to mix passing RBI and the Subtarget; should we pass
401 // TII/TRI as well?
403 *static_cast<const AArch64TargetMachine *>(&TM), *this, *RBI));
404
405 RegBankInfo.reset(RBI);
406
407 auto TRI = getRegisterInfo();
409 for (unsigned i = 0; i < 29; ++i) {
410 if (ReservedRegNames.count(TRI->getName(AArch64::X0 + i)))
412 }
413 // X30 is named LR, so we can't use TRI->getName to check X30.
414 if (ReservedRegNames.count("X30") || ReservedRegNames.count("LR"))
416 // X29 is named FP, so we can't use TRI->getName to check X29.
417 if (ReservedRegNames.count("X29") || ReservedRegNames.count("FP"))
419
421}
422
424 AArch64HwModeBits Modes = AArch64HwModeBits::DefaultMode;
425
426 // Use a special hardware mode in streaming[-compatible] functions with
427 // aarch64-enable-zpr-predicate-spills. This changes the spill size (and
428 // alignment) for the predicate register class.
431 Modes |= AArch64HwModeBits::SMEWithZPRPredicateSpills;
432 }
433
434 return to_underlying(Modes);
435}
436
438 return CallLoweringInfo.get();
439}
440
442 return InlineAsmLoweringInfo.get();
443}
444
446 return InstSelector.get();
447}
448
450 return Legalizer.get();
451}
452
454 return RegBankInfo.get();
455}
456
457/// Find the target operand flags that describe how a global value should be
458/// referenced for the current subtarget.
459unsigned
461 const TargetMachine &TM) const {
462 // MachO large model always goes via a GOT, simply to get a single 8-byte
463 // absolute relocation on all global addresses.
464 if (TM.getCodeModel() == CodeModel::Large && isTargetMachO())
465 return AArch64II::MO_GOT;
466
467 // All globals dynamically protected by MTE must have their address tags
468 // synthesized. This is done by having the loader stash the tag in the GOT
469 // entry. Force all tagged globals (even ones with internal linkage) through
470 // the GOT.
471 if (GV->isTagged())
472 return AArch64II::MO_GOT;
473
474 if (!TM.shouldAssumeDSOLocal(GV)) {
475 if (GV->hasDLLImportStorageClass()) {
477 }
478 if (getTargetTriple().isOSWindows())
480 return AArch64II::MO_GOT;
481 }
482
483 // The small code model's direct accesses use ADRP, which cannot
484 // necessarily produce the value 0 (if the code is above 4GB).
485 // Same for the tiny code model, where we have a pc relative LDR.
486 if ((useSmallAddressing() || TM.getCodeModel() == CodeModel::Tiny) &&
488 return AArch64II::MO_GOT;
489
490 // References to tagged globals are marked with MO_NC | MO_TAGGED to indicate
491 // that their nominal addresses are tagged and outside of the code model. In
492 // AArch64ExpandPseudo::expandMI we emit an additional instruction to set the
493 // tag if necessary based on MO_TAGGED.
494 if (AllowTaggedGlobals && !isa<FunctionType>(GV->getValueType()))
496
498}
499
501 const GlobalValue *GV, const TargetMachine &TM) const {
502 // MachO large model always goes via a GOT, because we don't have the
503 // relocations available to do anything else..
504 if (TM.getCodeModel() == CodeModel::Large && isTargetMachO() &&
505 !GV->hasInternalLinkage())
506 return AArch64II::MO_GOT;
507
508 // NonLazyBind goes via GOT unless we know it's available locally.
509 auto *F = dyn_cast<Function>(GV);
510 if ((!isTargetMachO() || MachOUseNonLazyBind) && F &&
511 F->hasFnAttribute(Attribute::NonLazyBind) && !TM.shouldAssumeDSOLocal(GV))
512 return AArch64II::MO_GOT;
513
514 if (getTargetTriple().isOSWindows()) {
515 if (isWindowsArm64EC() && GV->getValueType()->isFunctionTy()) {
516 if (GV->hasDLLImportStorageClass()) {
517 // On Arm64EC, if we're calling a symbol from the import table
518 // directly, use MO_ARM64EC_CALLMANGLE.
521 }
522 if (GV->hasExternalLinkage()) {
523 // If we're calling a symbol directly, use the mangled form in the
524 // call instruction.
526 }
527 }
528
529 // Use ClassifyGlobalReference for setting MO_DLLIMPORT/MO_COFFSTUB.
530 return ClassifyGlobalReference(GV, TM);
531 }
532
534}
535
537 const SchedRegion &Region) const {
538 // LNT run (at least on Cyclone) showed reasonably significant gains for
539 // bi-directional scheduling. 253.perlbmk.
540 Policy.OnlyTopDown = false;
541 Policy.OnlyBottomUp = false;
542 // Enabling or Disabling the latency heuristic is a close call: It seems to
543 // help nearly no benchmark on out-of-order architectures, on the other hand
544 // it regresses register pressure on a few benchmarking.
545 Policy.DisableLatencyHeuristic = DisableLatencySchedHeuristic;
546}
547
549 SUnit *Def, int DefOpIdx, SUnit *Use, int UseOpIdx, SDep &Dep,
550 const TargetSchedModel *SchedModel) const {
551 if (!SchedModel || Dep.getKind() != SDep::Kind::Data || !Dep.getReg() ||
552 !Def->isInstr() || !Use->isInstr() ||
553 (Def->getInstr()->getOpcode() != TargetOpcode::BUNDLE &&
554 Use->getInstr()->getOpcode() != TargetOpcode::BUNDLE))
555 return;
556
557 // If the Def is a BUNDLE, find the last instruction in the bundle that defs
558 // the register.
559 const MachineInstr *DefMI = Def->getInstr();
560 if (DefMI->getOpcode() == TargetOpcode::BUNDLE) {
561 Register Reg = DefMI->getOperand(DefOpIdx).getReg();
562 for (const auto &Op : const_mi_bundle_ops(*DefMI)) {
563 if (Op.isReg() && Op.isDef() && Op.getReg() == Reg) {
564 DefMI = Op.getParent();
565 DefOpIdx = Op.getOperandNo();
566 }
567 }
568 }
569
570 // If the Use is a BUNDLE, find the first instruction that uses the Reg.
571 const MachineInstr *UseMI = Use->getInstr();
572 if (UseMI->getOpcode() == TargetOpcode::BUNDLE) {
573 Register Reg = UseMI->getOperand(UseOpIdx).getReg();
574 for (const auto &Op : const_mi_bundle_ops(*UseMI)) {
575 if (Op.isReg() && Op.isUse() && Op.getReg() == Reg) {
576 UseMI = Op.getParent();
577 UseOpIdx = Op.getOperandNo();
578 break;
579 }
580 }
581 }
582
583 Dep.setLatency(
584 SchedModel->computeOperandLatency(DefMI, DefOpIdx, UseMI, UseOpIdx));
585}
586
589}
590
593 return false;
594
596 return true;
597 if (TargetTriple.isiOS()) {
599 }
600
601 return false;
602}
603
604std::unique_ptr<PBQPRAConstraint>
606 return balanceFPOps() ? std::make_unique<A57ChainingConstraint>() : nullptr;
607}
608
610 // We usually compute max call frame size after ISel. Do the computation now
611 // if the .mir file didn't specify it. Note that this will probably give you
612 // bogus values after PEI has eliminated the callframe setup/destroy pseudo
613 // instructions, specify explicitly if you need it to be correct.
614 MachineFrameInfo &MFI = MF.getFrameInfo();
617}
618
619bool AArch64Subtarget::useAA() const { return UseAA; }
620
622 // If SVE2 or SME is present (we are not SVE-1 only) and UseScalarIncVL
623 // is not otherwise set, enable it by default.
625 return UseScalarIncVL;
626 return hasSVE2() || hasSME();
627}
628
629// If return address signing is enabled, tail calls are emitted as follows:
630//
631// ```
632// <authenticate LR>
633// <check LR>
634// TCRETURN ; the callee may sign and spill the LR in its prologue
635// ```
636//
637// LR may require explicit checking because if FEAT_FPAC is not implemented
638// and LR was tampered with, then `<authenticate LR>` will not generate an
639// exception on its own. Later, if the callee spills the signed LR value and
640// neither FEAT_PAuth2 nor FEAT_EPAC are implemented, the valid PAC replaces
641// the higher bits of LR thus hiding the authentication failure.
643 const MachineFunction &MF) const {
644 // TODO: Check subtarget for the scheme. Present variant is a default for
645 // pauthtest ABI.
646 if (MF.getFunction().hasFnAttribute("ptrauth-returns") &&
647 MF.getFunction().hasFnAttribute("ptrauth-auth-traps"))
649 if (AuthenticatedLRCheckMethod.getNumOccurrences())
651
652 // At now, use None by default because checks may introduce an unexpected
653 // performance regression or incompatibility with execute-only mappings.
655}
656
657std::optional<uint16_t>
659 const Function &ParentFn) const {
660 if (!ParentFn.hasFnAttribute("ptrauth-indirect-gotos"))
661 return std::nullopt;
662 // We currently have one simple mechanism for all targets.
663 // This isn't ABI, so we can always do better in the future.
665 (Twine(ParentFn.getName()) + " blockaddress").str());
666}
667
669 // The Darwin kernel implements special protections for x16 and x17 so we
670 // should prefer to use those registers on that platform.
671 return isTargetDarwin();
672}
673
675 return getSchedModel().hasInstrSchedModel();
676}
This file describes how to lower LLVM calls to machine code calls.
MachineInstrBuilder & UseMI
MachineInstrBuilder MachineInstrBuilder & DefMI
This file declares the targeting of the Machinelegalizer class for AArch64.
#define AUTH_CHECK_METHOD_CL_VALUES_LR
This file declares the targeting of the RegisterBankInfo class for AArch64.
static cl::opt< bool > UseAddressTopByteIgnored("aarch64-use-tbi", cl::desc("Assume that top byte of " "an address is ignored"), cl::init(false), cl::Hidden)
static cl::opt< unsigned > AArch64MinimumJumpTableEntries("aarch64-min-jump-table-entries", cl::init(10), cl::Hidden, cl::desc("Set minimum number of entries to use a jump table on AArch64"))
static cl::opt< bool > MachOUseNonLazyBind("aarch64-macho-enable-nonlazybind", cl::desc("Call nonlazybind functions via direct GOT load for Mach-O"), cl::Hidden)
static cl::opt< AArch64PAuth::AuthCheckMethod > AuthenticatedLRCheckMethod("aarch64-authenticated-lr-check-method", cl::Hidden, cl::desc("Override the variant of check applied " "to authenticated LR during tail call"), cl::values(AUTH_CHECK_METHOD_CL_VALUES_LR))
static cl::opt< bool > EnableSubregLivenessTracking("aarch64-enable-subreg-liveness-tracking", cl::init(false), cl::Hidden, cl::desc("Enable subreg liveness tracking"))
static cl::opt< bool > EnableEarlyIfConvert("aarch64-early-ifcvt", cl::desc("Enable the early if " "converter pass"), cl::init(true), cl::Hidden)
static cl::opt< unsigned > AArch64StreamingHazardSize("aarch64-streaming-hazard-size", cl::desc("Hazard size for streaming mode memory accesses. 0 = disabled."), cl::init(0), cl::Hidden)
static cl::opt< bool > UseAA("aarch64-use-aa", cl::init(true), cl::desc("Enable the use of AA during codegen."))
static cl::alias AArch64StreamingStackHazardSize("aarch64-stack-hazard-size", cl::desc("alias for -aarch64-streaming-hazard-size"), cl::aliasopt(AArch64StreamingHazardSize))
static cl::opt< bool > UseScalarIncVL("sve-use-scalar-inc-vl", cl::init(false), cl::Hidden, cl::desc("Prefer add+cnt over addvl/inc/dec"))
static cl::opt< bool > EnableZPRPredicateSpills("aarch64-enable-zpr-predicate-spills", cl::init(false), cl::Hidden, cl::desc("Enables spilling/reloading SVE predicates as data vectors (ZPRs)"))
static cl::list< std::string > ReservedRegsForRA("reserve-regs-for-regalloc", cl::desc("Reserve physical " "registers, so they can't be used by register allocator. " "Should only be used for testing register allocator."), cl::CommaSeparated, cl::Hidden)
static cl::opt< unsigned > OverrideVectorInsertExtractBaseCost("aarch64-insert-extract-base-cost", cl::desc("Base cost of vector insert/extract element"), cl::Hidden)
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition: Compiler.h:404
#define F(x, y, z)
Definition: MD5.cpp:55
Register const TargetRegisterInfo * TRI
This class provides the information for the target register banks.
AArch64Subtarget(const Triple &TT, StringRef CPU, StringRef TuneCPU, StringRef FS, const TargetMachine &TM, bool LittleEndian, unsigned MinSVEVectorSizeInBitsOverride=0, unsigned MaxSVEVectorSizeInBitsOverride=0, bool IsStreaming=false, bool IsStreamingCompatible=false, bool HasMinSize=false)
This constructor initializes the data members to match that of the specified triple.
const CallLowering * getCallLowering() const override
const AArch64RegisterInfo * getRegisterInfo() const override
TailFoldingOpts DefaultSVETFOpts
std::unique_ptr< InstructionSelector > InstSelector
ARMProcFamilyEnum ARMProcFamily
ARMProcFamily - ARM processor family: Cortex-A53, Cortex-A57, and others.
std::unique_ptr< RegisterBankInfo > RegBankInfo
bool useSmallAddressing() const
bool enableEarlyIfConversion() const override
const InlineAsmLowering * getInlineAsmLowering() const override
unsigned getVectorInsertExtractBaseCost() const
bool enableMachinePipeliner() const override
std::unique_ptr< CallLowering > CallLoweringInfo
GlobalISel related APIs.
std::optional< uint16_t > getPtrAuthBlockAddressDiscriminatorIfEnabled(const Function &ParentFn) const
Compute the integer discriminator for a given BlockAddress constant, if blockaddress signing is enabl...
unsigned classifyGlobalFunctionReference(const GlobalValue *GV, const TargetMachine &TM) const
bool useAA() const override
const AArch64TargetLowering * getTargetLowering() const override
bool supportsAddressTopByteIgnored() const
CPU has TBI (top byte of addresses is ignored during HW address translation) and OS enables it.
void overrideSchedPolicy(MachineSchedPolicy &Policy, const SchedRegion &Region) const override
const Triple & getTargetTriple() const
bool isStreamingCompatible() const
Returns true if the function has a streaming-compatible body.
void adjustSchedDependency(SUnit *Def, int DefOpIdx, SUnit *Use, int UseOpIdx, SDep &Dep, const TargetSchedModel *SchedModel) const override
void mirFileLoaded(MachineFunction &MF) const override
Triple TargetTriple
TargetTriple - What processor and OS we're targeting.
InstructionSelector * getInstructionSelector() const override
unsigned ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const
ClassifyGlobalReference - Find the target operand flags that describe how a global value should be re...
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool isStreaming() const
Returns true if the function has a streaming body.
bool isX16X17Safer() const
Returns whether the operating system makes it safer to store sensitive values in x16 and x17 as oppos...
virtual unsigned getHwModeSet() const override
bool useScalarIncVL() const
Returns true to use the addvl/inc/dec instructions, as opposed to separate add + cnt instructions.
const LegalizerInfo * getLegalizerInfo() const override
std::unique_ptr< PBQPRAConstraint > getCustomPBQPConstraints() const override
AArch64PAuth::AuthCheckMethod getAuthenticatedLRCheckMethod(const MachineFunction &MF) const
Choose a method of checking LR before performing a tail call.
const RegisterBankInfo * getRegBankInfo() const override
std::unique_ptr< InlineAsmLowering > InlineAsmLoweringInfo
BitVector & set()
Definition: BitVector.h:351
This class represents an Operation in the Expression.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition: Function.cpp:727
bool hasExternalLinkage() const
Definition: GlobalValue.h:513
bool isTagged() const
Definition: GlobalValue.h:367
bool hasExternalWeakLinkage() const
Definition: GlobalValue.h:531
bool hasDLLImportStorageClass() const
Definition: GlobalValue.h:280
bool hasInternalLinkage() const
Definition: GlobalValue.h:528
Type * getValueType() const
Definition: GlobalValue.h:298
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
LLVM_ABI void computeMaxCallFrameSize(MachineFunction &MF, std::vector< MachineBasicBlock::iterator > *FrameSDOps=nullptr)
Computes the maximum size of a callframe.
bool isMaxCallFrameSizeComputed() const
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Function & getFunction()
Return the LLVM function that this machine code represents.
Representation of each machine instruction.
Definition: MachineInstr.h:72
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
Definition: MachineInstr.h:587
const MachineOperand & getOperand(unsigned i) const
Definition: MachineInstr.h:595
Register getReg() const
getReg - Returns the register number.
Holds all the information related to register banks.
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
Scheduling dependency.
Definition: ScheduleDAG.h:51
Kind getKind() const
Returns an enum value representing the kind of the dependence.
Definition: ScheduleDAG.h:513
@ Data
Regular data dependence (aka true-dependence).
Definition: ScheduleDAG.h:55
void setLatency(unsigned Lat)
Sets the latency for this edge.
Definition: ScheduleDAG.h:147
Register getReg() const
Returns the register associated with this edge.
Definition: ScheduleDAG.h:216
Scheduling unit. This is a node in the scheduling DAG.
Definition: ScheduleDAG.h:249
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
Definition: StringMap.h:280
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:151
StringSet - A wrapper for StringMap that provides set-like functionality.
Definition: StringSet.h:25
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:83
Provide an instruction scheduling machine model to CodeGen passes.
LLVM_ABI unsigned computeOperandLatency(const MachineInstr *DefMI, unsigned DefOperIdx, const MachineInstr *UseMI, unsigned UseOperIdx) const
Compute operand latency based on the available machine model.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:47
bool isDriverKit() const
Is this an Apple DriverKit triple.
Definition: Triple.h:597
bool isiOS() const
Is this an iOS triple.
Definition: Triple.h:572
LLVM_ABI VersionTuple getiOSVersion() const
Parse the version number as with getOSVersion.
Definition: Triple.cpp:1497
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:82
bool isFunctionTy() const
True if this is an instance of FunctionType.
Definition: Type.h:258
A Use represents the edge between a Value definition and its users.
Definition: Use.h:35
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:322
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:30
int getNumOccurrences() const
Definition: CommandLine.h:400
DataType & getValue()
Definition: CommandLine.h:1358
@ MO_DLLIMPORT
MO_DLLIMPORT - On a symbol operand, this represents that the reference to the symbol is for an import...
@ MO_NC
MO_NC - Indicates whether the linker is expected to check the symbol reference for overflow.
@ MO_GOT
MO_GOT - This flag indicates that a symbol operand represents the address of the GOT entry for the sy...
@ MO_ARM64EC_CALLMANGLE
MO_ARM64EC_CALLMANGLE - Operand refers to the Arm64EC-mangled version of a symbol,...
@ MO_TAGGED
MO_TAGGED - With MO_PAGE, indicates that the page includes a memory tag in bits 56-63.
@ MO_COFFSTUB
MO_COFFSTUB - On a symbol operand "FOO", this indicates that the reference is actually to the "....
AuthCheckMethod
Variants of check performed on an authenticated pointer.
@ HighBitsNoTBI
Check by comparing bits 62 and 61 of the authenticated address.
@ None
Do not check the value at all.
LLVM_ABI bool isX18ReservedByDefault(const Triple &TT)
ValuesClass values(OptsTy... Options)
Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...
Definition: CommandLine.h:712
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:444
@ CommaSeparated
Definition: CommandLine.h:164
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
constexpr from_range_t from_range
InstructionSelector * createAArch64InstructionSelector(const AArch64TargetMachine &, const AArch64Subtarget &, const AArch64RegisterBankInfo &)
constexpr std::underlying_type_t< Enum > to_underlying(Enum E)
Returns underlying integer value of an enum.
iterator_range< ConstMIBundleOperands > const_mi_bundle_ops(const MachineInstr &MI)
LLVM_ABI uint16_t getPointerAuthStableSipHash(StringRef S)
Compute a stable non-zero 16-bit hash of the given string.
Definition: SipHash.cpp:39
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:856
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
Define a generic scheduling policy for targets that don't provide their own MachineSchedStrategy.
A region of an MBB for scheduling.