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 VScaleForTuningOpt("sve-vscale-for-tuning", cl::Hidden,
91 cl::desc("Force a vscale for tuning factor for SVE"));
92
93// Subreg liveness tracking is disabled by default for now until all issues
94// are ironed out. This option allows the feature to be used in tests.
95static cl::opt<bool>
96 EnableSubregLivenessTracking("aarch64-enable-subreg-liveness-tracking",
97 cl::init(false), cl::Hidden,
98 cl::desc("Enable subreg liveness tracking"));
99
100static cl::opt<bool>
101 UseScalarIncVL("sve-use-scalar-inc-vl", cl::init(false), cl::Hidden,
102 cl::desc("Prefer add+cnt over addvl/inc/dec"));
103
109
110AArch64Subtarget &AArch64Subtarget::initializeSubtargetDependencies(
111 StringRef FS, StringRef CPUString, StringRef TuneCPUString,
112 bool HasMinSize) {
113 // Determine default and user-specified characteristics
114
115 if (CPUString.empty())
116 CPUString = "generic";
117
118 if (TuneCPUString.empty())
119 TuneCPUString = CPUString;
120
121 ParseSubtargetFeatures(CPUString, TuneCPUString, FS);
122 initializeProperties(HasMinSize);
123
124 return *this;
125}
126
127void AArch64Subtarget::initializeProperties(bool HasMinSize) {
128 // Initialize CPU specific properties. We should add a tablegen feature for
129 // this in the future so we can specify it together with the subtarget
130 // features.
131 switch (ARMProcFamily) {
132 case Generic:
133 // Using TuneCPU=generic we avoid ldapur instructions to line up with the
134 // cpus that use the AvoidLDAPUR feature. We don't want this to be on
135 // forever, so it is enabled between armv8.4 and armv8.7/armv9.2.
136 if (hasV8_4aOps() && !hasV8_8aOps())
137 AvoidLDAPUR = true;
138 break;
139 case Carmel:
140 CacheLineSize = 64;
141 break;
142 case CortexA35:
143 case CortexA53:
144 case CortexA55:
145 case CortexR82:
146 case CortexR82AE:
150 break;
151 case CortexA57:
156 break;
157 case CortexA65:
159 break;
160 case CortexA72:
161 case CortexA73:
162 case CortexA75:
166 break;
167 case CortexA76:
168 case CortexA77:
169 case CortexA78:
170 case CortexA78AE:
171 case CortexA78C:
172 case CortexX1:
176 break;
177 case CortexA320:
178 case CortexA510:
179 case CortexA520:
181 VScaleForTuning = 1;
184 break;
185 case CortexA710:
186 case CortexA715:
187 case CortexA720:
188 case CortexA725:
189 case CortexX2:
190 case CortexX3:
191 case CortexX4:
192 case CortexX925:
194 VScaleForTuning = 1;
197 break;
198 case A64FX:
199 CacheLineSize = 256;
203 PrefetchDistance = 128;
204 MinPrefetchStride = 1024;
206 VScaleForTuning = 4;
207 break;
208 case MONAKA:
209 VScaleForTuning = 2;
210 break;
211 case AppleA7:
212 case AppleA10:
213 case AppleA11:
214 case AppleA12:
215 case AppleA13:
216 case AppleA14:
217 case AppleA15:
218 case AppleA16:
219 case AppleA17:
220 case AppleM4:
221 CacheLineSize = 64;
222 PrefetchDistance = 280;
223 MinPrefetchStride = 2048;
225 if (isAppleMLike())
227 break;
228 case ExynosM3:
230 MaxJumpTableSize = 20;
233 break;
234 case Falkor:
236 // FIXME: remove this to enable 64-bit SLP if performance looks good.
238 CacheLineSize = 128;
239 PrefetchDistance = 820;
240 MinPrefetchStride = 2048;
242 break;
243 case Kryo:
246 CacheLineSize = 128;
247 PrefetchDistance = 740;
248 MinPrefetchStride = 1024;
250 // FIXME: remove this to enable 64-bit SLP if performance looks good.
252 break;
253 case NeoverseE1:
255 break;
256 case NeoverseN1:
260 break;
261 case NeoverseV2:
262 case NeoverseV3:
263 CacheLineSize = 64;
266 ScatterOverhead = 13;
267 [[fallthrough]];
268 case NeoverseN2:
269 case NeoverseN3:
273 VScaleForTuning = 1;
274 break;
275 case NeoverseV1:
279 VScaleForTuning = 2;
281 break;
282 case Neoverse512TVB:
284 VScaleForTuning = 1;
286 break;
287 case Saphira:
289 // FIXME: remove this to enable 64-bit SLP if performance looks good.
291 break;
292 case ThunderX2T99:
293 CacheLineSize = 64;
297 PrefetchDistance = 128;
298 MinPrefetchStride = 1024;
300 // FIXME: remove this to enable 64-bit SLP if performance looks good.
302 break;
303 case ThunderX:
304 case ThunderXT88:
305 case ThunderXT81:
306 case ThunderXT83:
307 CacheLineSize = 128;
310 // FIXME: remove this to enable 64-bit SLP if performance looks good.
312 break;
313 case TSV110:
314 CacheLineSize = 64;
317 break;
318 case ThunderX3T110:
319 CacheLineSize = 64;
323 PrefetchDistance = 128;
324 MinPrefetchStride = 1024;
326 // FIXME: remove this to enable 64-bit SLP if performance looks good.
328 break;
329 case Ampere1:
330 case Ampere1A:
331 case Ampere1B:
332 CacheLineSize = 64;
336 break;
337 case Oryon:
338 CacheLineSize = 64;
341 PrefetchDistance = 128;
342 MinPrefetchStride = 1024;
343 break;
344 case Olympus:
347 ScatterOverhead = 13;
351 VScaleForTuning = 1;
352 break;
353 }
354
355 if (AArch64MinimumJumpTableEntries.getNumOccurrences() > 0 || !HasMinSize)
357 if (VScaleForTuningOpt.getNumOccurrences() > 0)
359}
360
362 StringRef TuneCPU, StringRef FS,
363 const TargetMachine &TM, bool LittleEndian,
364 unsigned MinSVEVectorSizeInBitsOverride,
365 unsigned MaxSVEVectorSizeInBitsOverride,
367 bool HasMinSize)
368 : AArch64GenSubtargetInfo(TT, CPU, TuneCPU, FS),
369 ReserveXRegister(AArch64::GPR64commonRegClass.getNumRegs()),
370 ReserveXRegisterForRA(AArch64::GPR64commonRegClass.getNumRegs()),
371 CustomCallSavedXRegs(AArch64::GPR64commonRegClass.getNumRegs()),
372 IsLittle(LittleEndian), IsStreaming(IsStreaming),
375 AArch64StreamingHazardSize.getNumOccurrences() > 0
377 : std::nullopt),
378 MinSVEVectorSizeInBits(MinSVEVectorSizeInBitsOverride),
379 MaxSVEVectorSizeInBits(MaxSVEVectorSizeInBitsOverride), TargetTriple(TT),
380 InstrInfo(initializeSubtargetDependencies(FS, CPU, TuneCPU, HasMinSize)),
381 TLInfo(TM, *this) {
383 ReserveXRegister.set(18);
384
387 Legalizer.reset(new AArch64LegalizerInfo(*this));
388
389 auto *RBI = new AArch64RegisterBankInfo(*getRegisterInfo());
390
391 // FIXME: At this point, we can't rely on Subtarget having RBI.
392 // It's awkward to mix passing RBI and the Subtarget; should we pass
393 // TII/TRI as well?
395 *static_cast<const AArch64TargetMachine *>(&TM), *this, *RBI));
396
397 RegBankInfo.reset(RBI);
398
399 auto TRI = getRegisterInfo();
401 for (unsigned i = 0; i < 29; ++i) {
402 if (ReservedRegNames.count(TRI->getName(AArch64::X0 + i)))
404 }
405 // X30 is named LR, so we can't use TRI->getName to check X30.
406 if (ReservedRegNames.count("X30") || ReservedRegNames.count("LR"))
407 ReserveXRegisterForRA.set(30);
408 // X29 is named FP, so we can't use TRI->getName to check X29.
409 if (ReservedRegNames.count("X29") || ReservedRegNames.count("FP"))
410 ReserveXRegisterForRA.set(29);
411
413}
414
418
422
426
428 return Legalizer.get();
429}
430
432 return RegBankInfo.get();
433}
434
435/// Find the target operand flags that describe how a global value should be
436/// referenced for the current subtarget.
437unsigned
439 const TargetMachine &TM) const {
440 // MachO large model always goes via a GOT, simply to get a single 8-byte
441 // absolute relocation on all global addresses.
443 return AArch64II::MO_GOT;
444
445 // All globals dynamically protected by MTE must have their address tags
446 // synthesized. This is done by having the loader stash the tag in the GOT
447 // entry. Force all tagged globals (even ones with internal linkage) through
448 // the GOT.
449 if (GV->isTagged())
450 return AArch64II::MO_GOT;
451
452 if (!TM.shouldAssumeDSOLocal(GV)) {
453 if (GV->hasDLLImportStorageClass()) {
455 }
456 if (getTargetTriple().isOSWindows())
458 return AArch64II::MO_GOT;
459 }
460
461 // The small code model's direct accesses use ADRP, which cannot
462 // necessarily produce the value 0 (if the code is above 4GB).
463 // Same for the tiny code model, where we have a pc relative LDR.
466 return AArch64II::MO_GOT;
467
468 // References to tagged globals are marked with MO_NC | MO_TAGGED to indicate
469 // that their nominal addresses are tagged and outside of the code model. In
470 // AArch64ExpandPseudo::expandMI we emit an additional instruction to set the
471 // tag if necessary based on MO_TAGGED.
472 if (AllowTaggedGlobals && !isa<FunctionType>(GV->getValueType()))
474
476}
477
479 const GlobalValue *GV, const TargetMachine &TM) const {
480 // MachO large model always goes via a GOT, because we don't have the
481 // relocations available to do anything else..
483 !GV->hasInternalLinkage())
484 return AArch64II::MO_GOT;
485
486 // NonLazyBind goes via GOT unless we know it's available locally.
487 auto *F = dyn_cast<Function>(GV);
488 if ((!isTargetMachO() || MachOUseNonLazyBind) && F &&
489 F->hasFnAttribute(Attribute::NonLazyBind) && !TM.shouldAssumeDSOLocal(GV))
490 return AArch64II::MO_GOT;
491
492 if (getTargetTriple().isOSWindows()) {
493 if (isWindowsArm64EC() && GV->getValueType()->isFunctionTy()) {
494 if (GV->hasDLLImportStorageClass()) {
495 // On Arm64EC, if we're calling a symbol from the import table
496 // directly, use MO_ARM64EC_CALLMANGLE.
499 }
500 if (GV->hasExternalLinkage()) {
501 // If we're calling a symbol directly, use the mangled form in the
502 // call instruction.
504 }
505 }
506
507 // Use ClassifyGlobalReference for setting MO_DLLIMPORT/MO_COFFSTUB.
508 return ClassifyGlobalReference(GV, TM);
509 }
510
512}
513
515 const SchedRegion &Region) const {
516 // LNT run (at least on Cyclone) showed reasonably significant gains for
517 // bi-directional scheduling. 253.perlbmk.
518 Policy.OnlyTopDown = false;
519 Policy.OnlyBottomUp = false;
520 // Enabling or Disabling the latency heuristic is a close call: It seems to
521 // help nearly no benchmark on out-of-order architectures, on the other hand
522 // it regresses register pressure on a few benchmarking.
523 Policy.DisableLatencyHeuristic = DisableLatencySchedHeuristic;
524}
525
527 SUnit *Def, int DefOpIdx, SUnit *Use, int UseOpIdx, SDep &Dep,
528 const TargetSchedModel *SchedModel) const {
529 if (!SchedModel || Dep.getKind() != SDep::Kind::Data || !Dep.getReg() ||
530 !Def->isInstr() || !Use->isInstr() ||
531 (Def->getInstr()->getOpcode() != TargetOpcode::BUNDLE &&
532 Use->getInstr()->getOpcode() != TargetOpcode::BUNDLE))
533 return;
534
535 // If the Def is a BUNDLE, find the last instruction in the bundle that defs
536 // the register.
537 const MachineInstr *DefMI = Def->getInstr();
538 if (DefMI->getOpcode() == TargetOpcode::BUNDLE) {
539 Register Reg = DefMI->getOperand(DefOpIdx).getReg();
540 for (const auto &Op : const_mi_bundle_ops(*DefMI)) {
541 if (Op.isReg() && Op.isDef() && Op.getReg() == Reg) {
542 DefMI = Op.getParent();
543 DefOpIdx = Op.getOperandNo();
544 }
545 }
546 }
547
548 // If the Use is a BUNDLE, find the first instruction that uses the Reg.
549 const MachineInstr *UseMI = Use->getInstr();
550 if (UseMI->getOpcode() == TargetOpcode::BUNDLE) {
551 Register Reg = UseMI->getOperand(UseOpIdx).getReg();
552 for (const auto &Op : const_mi_bundle_ops(*UseMI)) {
553 if (Op.isReg() && Op.isUse() && Op.getReg() == Reg) {
554 UseMI = Op.getParent();
555 UseOpIdx = Op.getOperandNo();
556 break;
557 }
558 }
559 }
560
561 Dep.setLatency(
562 SchedModel->computeOperandLatency(DefMI, DefOpIdx, UseMI, UseOpIdx));
563}
564
568
571 return false;
572
573 if (TargetTriple.isDriverKit())
574 return true;
575 if (TargetTriple.isiOS()) {
576 return TargetTriple.getiOSVersion() >= VersionTuple(8);
577 }
578
579 return false;
580}
581
582std::unique_ptr<PBQPRAConstraint>
584 return balanceFPOps() ? std::make_unique<A57ChainingConstraint>() : nullptr;
585}
586
588 // We usually compute max call frame size after ISel. Do the computation now
589 // if the .mir file didn't specify it. Note that this will probably give you
590 // bogus values after PEI has eliminated the callframe setup/destroy pseudo
591 // instructions, specify explicitly if you need it to be correct.
592 MachineFrameInfo &MFI = MF.getFrameInfo();
595}
596
597bool AArch64Subtarget::useAA() const { return UseAA; }
598
600 // If SVE2 or SME is present (we are not SVE-1 only) and UseScalarIncVL
601 // is not otherwise set, enable it by default.
602 if (UseScalarIncVL.getNumOccurrences())
603 return UseScalarIncVL;
604 return hasSVE2() || hasSME();
605}
606
607// If return address signing is enabled, tail calls are emitted as follows:
608//
609// ```
610// <authenticate LR>
611// <check LR>
612// TCRETURN ; the callee may sign and spill the LR in its prologue
613// ```
614//
615// LR may require explicit checking because if FEAT_FPAC is not implemented
616// and LR was tampered with, then `<authenticate LR>` will not generate an
617// exception on its own. Later, if the callee spills the signed LR value and
618// neither FEAT_PAuth2 nor FEAT_EPAC are implemented, the valid PAC replaces
619// the higher bits of LR thus hiding the authentication failure.
621 const MachineFunction &MF) const {
622 // TODO: Check subtarget for the scheme. Present variant is a default for
623 // pauthtest ABI.
624 if (MF.getFunction().hasFnAttribute("ptrauth-returns") &&
625 MF.getFunction().hasFnAttribute("ptrauth-auth-traps"))
627 if (AuthenticatedLRCheckMethod.getNumOccurrences())
629
630 // At now, use None by default because checks may introduce an unexpected
631 // performance regression or incompatibility with execute-only mappings.
633}
634
635std::optional<uint16_t>
637 const Function &ParentFn) const {
638 if (!ParentFn.hasFnAttribute("ptrauth-indirect-gotos"))
639 return std::nullopt;
640 // We currently have one simple mechanism for all targets.
641 // This isn't ABI, so we can always do better in the future.
643 (Twine(ParentFn.getName()) + " blockaddress").str());
644}
645
647 // The Darwin kernel implements special protections for x16 and x17 so we
648 // should prefer to use those registers on that platform.
649 return isTargetDarwin();
650}
651
653 return getSchedModel().hasInstrSchedModel();
654}
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.
@ Generic
#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< unsigned > VScaleForTuningOpt("sve-vscale-for-tuning", cl::Hidden, cl::desc("Force a vscale for tuning factor for SVE"))
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)
static cl::opt< unsigned > MinPrefetchStride("min-prefetch-stride", cl::desc("Min stride to add prefetches"), cl::Hidden)
static cl::opt< unsigned > PrefetchDistance("prefetch-distance", cl::desc("Number of instructions to prefetch ahead"), cl::Hidden)
static cl::opt< unsigned > MaxPrefetchIterationsAhead("max-prefetch-iters-ahead", cl::desc("Max number of iterations to prefetch ahead"), cl::Hidden)
static const unsigned MaxInterleaveFactor
Maximum vectorization interleave count.
static cl::opt< unsigned > EpilogueVectorizationMinVF("epilogue-vectorization-minimum-VF", cl::Hidden, cl::desc("Only loops with vectorization factor equal to or larger than " "the specified value are considered for epilogue vectorization."))
#define F(x, y, z)
Definition MD5.cpp:54
Register const TargetRegisterInfo * TRI
static cl::opt< unsigned > CacheLineSize("cache-line-size", cl::init(0), cl::Hidden, cl::desc("Use this to override the target cache line size when " "specified by the user."))
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
std::optional< unsigned > StreamingHazardSize
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
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 isX16X17Safer() const
Returns whether the operating system makes it safer to store sensitive values in x16 and x17 as oppos...
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.
AArch64InstrInfo InstrInfo
AArch64TargetLowering TLInfo
const RegisterBankInfo * getRegBankInfo() const override
std::unique_ptr< LegalizerInfo > Legalizer
std::unique_ptr< InlineAsmLowering > InlineAsmLoweringInfo
bool isAppleMLike() const
Returns true if the processor is an Apple M-series or aligned A-series (A14 or newer).
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition Function.cpp:730
bool hasExternalLinkage() const
bool isTagged() const
bool hasExternalWeakLinkage() const
bool hasDLLImportStorageClass() const
bool hasInternalLinkage() const
Type * getValueType() const
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.
Holds all the information related to register banks.
Wrapper class representing virtual and physical registers.
Definition Register.h:20
Scheduling dependency.
Definition ScheduleDAG.h:51
Kind getKind() const
Returns an enum value representing the kind of the dependence.
@ Data
Regular data dependence (aka true-dependence).
Definition ScheduleDAG.h:55
void setLatency(unsigned Lat)
Sets the latency for this edge.
Register getReg() const
Returns the register associated with this edge.
Scheduling unit. This is a node in the scheduling DAG.
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
Definition StringMap.h:285
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:143
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.
bool shouldAssumeDSOLocal(const GlobalValue *GV) const
CodeModel::Model getCodeModel() const
Returns the code model.
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
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]]].
@ 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 ...
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
constexpr from_range_t from_range
InstructionSelector * createAArch64InstructionSelector(const AArch64TargetMachine &, const AArch64Subtarget &, const AArch64RegisterBankInfo &)
iterator_range< ConstMIBundleOperands > const_mi_bundle_ops(const MachineInstr &MI)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
LLVM_ABI uint16_t getPointerAuthStableSipHash(StringRef S)
Compute a stable non-zero 16-bit hash of the given string.
Definition SipHash.cpp:49
DWARFExpression::Operation Op
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:867
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.