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
95 VScaleForTuningOpt("sve-vscale-for-tuning", cl::Hidden,
96 cl::desc("Force a vscale for tuning factor for SVE"));
97
98// Subreg liveness tracking is disabled by default for now until all issues
99// are ironed out. This option allows the feature to be used in tests.
100static cl::opt<bool>
101 EnableSubregLivenessTracking("aarch64-enable-subreg-liveness-tracking",
102 cl::init(false), cl::Hidden,
103 cl::desc("Enable subreg liveness tracking"));
104
105static cl::opt<bool>
106 UseScalarIncVL("sve-use-scalar-inc-vl", cl::init(false), cl::Hidden,
107 cl::desc("Prefer add+cnt over addvl/inc/dec"));
108
114
115AArch64Subtarget &AArch64Subtarget::initializeSubtargetDependencies(
116 StringRef FS, StringRef CPUString, StringRef TuneCPUString,
117 bool HasMinSize) {
118 // Determine default and user-specified characteristics
119
120 if (CPUString.empty())
121 CPUString = "generic";
122
123 if (TuneCPUString.empty())
124 TuneCPUString = CPUString;
125
126 ParseSubtargetFeatures(CPUString, TuneCPUString, FS);
127 initializeProperties(HasMinSize);
128
129 return *this;
130}
131
132void AArch64Subtarget::initializeProperties(bool HasMinSize) {
133 // Initialize CPU specific properties. We should add a tablegen feature for
134 // this in the future so we can specify it together with the subtarget
135 // features.
136 switch (ARMProcFamily) {
137 case Generic:
138 // Using TuneCPU=generic we avoid ldapur instructions to line up with the
139 // cpus that use the AvoidLDAPUR feature. We don't want this to be on
140 // forever, so it is enabled between armv8.4 and armv8.7/armv9.2.
141 if (hasV8_4aOps() && !hasV8_8aOps())
142 AvoidLDAPUR = true;
143 break;
144 case Carmel:
145 CacheLineSize = 64;
146 break;
147 case CortexA35:
148 case CortexA53:
149 case CortexA55:
150 case CortexR82:
151 case CortexR82AE:
155 break;
156 case CortexA57:
161 break;
162 case CortexA65:
164 break;
165 case CortexA72:
166 case CortexA73:
167 case CortexA75:
171 break;
172 case CortexA76:
173 case CortexA77:
174 case CortexA78:
175 case CortexA78AE:
176 case CortexA78C:
177 case CortexX1:
181 break;
182 case CortexA320:
183 case CortexA510:
184 case CortexA520:
186 VScaleForTuning = 1;
189 break;
190 case CortexA710:
191 case CortexA715:
192 case CortexA720:
193 case CortexA725:
194 case CortexX2:
195 case CortexX3:
196 case CortexX4:
197 case CortexX925:
199 VScaleForTuning = 1;
202 break;
203 case A64FX:
204 CacheLineSize = 256;
208 PrefetchDistance = 128;
209 MinPrefetchStride = 1024;
211 VScaleForTuning = 4;
212 break;
213 case MONAKA:
214 VScaleForTuning = 2;
215 break;
216 case AppleA7:
217 case AppleA10:
218 case AppleA11:
219 case AppleA12:
220 case AppleA13:
221 case AppleA14:
222 case AppleA15:
223 case AppleA16:
224 case AppleA17:
225 case AppleM4:
226 CacheLineSize = 64;
227 PrefetchDistance = 280;
228 MinPrefetchStride = 2048;
230 switch (ARMProcFamily) {
231 case AppleA14:
232 case AppleA15:
233 case AppleA16:
234 case AppleA17:
235 case AppleM4:
237 break;
238 default:
239 break;
240 }
241 break;
242 case ExynosM3:
244 MaxJumpTableSize = 20;
247 break;
248 case Falkor:
250 // FIXME: remove this to enable 64-bit SLP if performance looks good.
252 CacheLineSize = 128;
253 PrefetchDistance = 820;
254 MinPrefetchStride = 2048;
256 break;
257 case Kryo:
260 CacheLineSize = 128;
261 PrefetchDistance = 740;
262 MinPrefetchStride = 1024;
264 // FIXME: remove this to enable 64-bit SLP if performance looks good.
266 break;
267 case NeoverseE1:
269 break;
270 case NeoverseN1:
274 break;
275 case NeoverseV2:
276 case NeoverseV3:
277 CacheLineSize = 64;
280 ScatterOverhead = 13;
282 case NeoverseN2:
283 case NeoverseN3:
287 VScaleForTuning = 1;
288 break;
289 case NeoverseV1:
293 VScaleForTuning = 2;
295 break;
296 case Neoverse512TVB:
298 VScaleForTuning = 1;
300 break;
301 case Saphira:
303 // FIXME: remove this to enable 64-bit SLP if performance looks good.
305 break;
306 case ThunderX2T99:
307 CacheLineSize = 64;
311 PrefetchDistance = 128;
312 MinPrefetchStride = 1024;
314 // FIXME: remove this to enable 64-bit SLP if performance looks good.
316 break;
317 case ThunderX:
318 case ThunderXT88:
319 case ThunderXT81:
320 case ThunderXT83:
321 CacheLineSize = 128;
324 // FIXME: remove this to enable 64-bit SLP if performance looks good.
326 break;
327 case TSV110:
328 CacheLineSize = 64;
331 break;
332 case ThunderX3T110:
333 CacheLineSize = 64;
337 PrefetchDistance = 128;
338 MinPrefetchStride = 1024;
340 // FIXME: remove this to enable 64-bit SLP if performance looks good.
342 break;
343 case Ampere1:
344 case Ampere1A:
345 case Ampere1B:
346 CacheLineSize = 64;
350 break;
351 case Oryon:
352 CacheLineSize = 64;
355 PrefetchDistance = 128;
356 MinPrefetchStride = 1024;
357 break;
358 case Olympus:
361 ScatterOverhead = 13;
365 VScaleForTuning = 1;
366 break;
367 }
368
369 if (AArch64MinimumJumpTableEntries.getNumOccurrences() > 0 || !HasMinSize)
371 if (VScaleForTuningOpt.getNumOccurrences() > 0)
373}
374
376 StringRef TuneCPU, StringRef FS,
377 const TargetMachine &TM, bool LittleEndian,
378 unsigned MinSVEVectorSizeInBitsOverride,
379 unsigned MaxSVEVectorSizeInBitsOverride,
381 bool HasMinSize)
382 : AArch64GenSubtargetInfo(TT, CPU, TuneCPU, FS),
383 ReserveXRegister(AArch64::GPR64commonRegClass.getNumRegs()),
384 ReserveXRegisterForRA(AArch64::GPR64commonRegClass.getNumRegs()),
385 CustomCallSavedXRegs(AArch64::GPR64commonRegClass.getNumRegs()),
386 IsLittle(LittleEndian), IsStreaming(IsStreaming),
389 AArch64StreamingHazardSize.getNumOccurrences() > 0
391 : std::nullopt),
392 MinSVEVectorSizeInBits(MinSVEVectorSizeInBitsOverride),
393 MaxSVEVectorSizeInBits(MaxSVEVectorSizeInBitsOverride), TargetTriple(TT),
394 InstrInfo(initializeSubtargetDependencies(FS, CPU, TuneCPU, HasMinSize)),
395 TLInfo(TM, *this) {
397 ReserveXRegister.set(18);
398
401 Legalizer.reset(new AArch64LegalizerInfo(*this));
402
403 auto *RBI = new AArch64RegisterBankInfo(*getRegisterInfo());
404
405 // FIXME: At this point, we can't rely on Subtarget having RBI.
406 // It's awkward to mix passing RBI and the Subtarget; should we pass
407 // TII/TRI as well?
409 *static_cast<const AArch64TargetMachine *>(&TM), *this, *RBI));
410
411 RegBankInfo.reset(RBI);
412
413 auto TRI = getRegisterInfo();
415 for (unsigned i = 0; i < 29; ++i) {
416 if (ReservedRegNames.count(TRI->getName(AArch64::X0 + i)))
418 }
419 // X30 is named LR, so we can't use TRI->getName to check X30.
420 if (ReservedRegNames.count("X30") || ReservedRegNames.count("LR"))
421 ReserveXRegisterForRA.set(30);
422 // X29 is named FP, so we can't use TRI->getName to check X29.
423 if (ReservedRegNames.count("X29") || ReservedRegNames.count("FP"))
424 ReserveXRegisterForRA.set(29);
425
427}
428
430 AArch64HwModeBits Modes = AArch64HwModeBits::DefaultMode;
431
432 // Use a special hardware mode in streaming[-compatible] functions with
433 // aarch64-enable-zpr-predicate-spills. This changes the spill size (and
434 // alignment) for the predicate register class.
435 if (EnableZPRPredicateSpills.getValue() &&
437 Modes |= AArch64HwModeBits::SMEWithZPRPredicateSpills;
438 }
439
440 return to_underlying(Modes);
441}
442
446
450
454
456 return Legalizer.get();
457}
458
460 return RegBankInfo.get();
461}
462
463/// Find the target operand flags that describe how a global value should be
464/// referenced for the current subtarget.
465unsigned
467 const TargetMachine &TM) const {
468 // MachO large model always goes via a GOT, simply to get a single 8-byte
469 // absolute relocation on all global addresses.
470 if (TM.getCodeModel() == CodeModel::Large && isTargetMachO())
471 return AArch64II::MO_GOT;
472
473 // All globals dynamically protected by MTE must have their address tags
474 // synthesized. This is done by having the loader stash the tag in the GOT
475 // entry. Force all tagged globals (even ones with internal linkage) through
476 // the GOT.
477 if (GV->isTagged())
478 return AArch64II::MO_GOT;
479
480 if (!TM.shouldAssumeDSOLocal(GV)) {
481 if (GV->hasDLLImportStorageClass()) {
483 }
484 if (getTargetTriple().isOSWindows())
486 return AArch64II::MO_GOT;
487 }
488
489 // The small code model's direct accesses use ADRP, which cannot
490 // necessarily produce the value 0 (if the code is above 4GB).
491 // Same for the tiny code model, where we have a pc relative LDR.
492 if ((useSmallAddressing() || TM.getCodeModel() == CodeModel::Tiny) &&
494 return AArch64II::MO_GOT;
495
496 // References to tagged globals are marked with MO_NC | MO_TAGGED to indicate
497 // that their nominal addresses are tagged and outside of the code model. In
498 // AArch64ExpandPseudo::expandMI we emit an additional instruction to set the
499 // tag if necessary based on MO_TAGGED.
500 if (AllowTaggedGlobals && !isa<FunctionType>(GV->getValueType()))
502
504}
505
507 const GlobalValue *GV, const TargetMachine &TM) const {
508 // MachO large model always goes via a GOT, because we don't have the
509 // relocations available to do anything else..
510 if (TM.getCodeModel() == CodeModel::Large && isTargetMachO() &&
511 !GV->hasInternalLinkage())
512 return AArch64II::MO_GOT;
513
514 // NonLazyBind goes via GOT unless we know it's available locally.
515 auto *F = dyn_cast<Function>(GV);
516 if ((!isTargetMachO() || MachOUseNonLazyBind) && F &&
517 F->hasFnAttribute(Attribute::NonLazyBind) && !TM.shouldAssumeDSOLocal(GV))
518 return AArch64II::MO_GOT;
519
520 if (getTargetTriple().isOSWindows()) {
521 if (isWindowsArm64EC() && GV->getValueType()->isFunctionTy()) {
522 if (GV->hasDLLImportStorageClass()) {
523 // On Arm64EC, if we're calling a symbol from the import table
524 // directly, use MO_ARM64EC_CALLMANGLE.
527 }
528 if (GV->hasExternalLinkage()) {
529 // If we're calling a symbol directly, use the mangled form in the
530 // call instruction.
532 }
533 }
534
535 // Use ClassifyGlobalReference for setting MO_DLLIMPORT/MO_COFFSTUB.
536 return ClassifyGlobalReference(GV, TM);
537 }
538
540}
541
543 const SchedRegion &Region) const {
544 // LNT run (at least on Cyclone) showed reasonably significant gains for
545 // bi-directional scheduling. 253.perlbmk.
546 Policy.OnlyTopDown = false;
547 Policy.OnlyBottomUp = false;
548 // Enabling or Disabling the latency heuristic is a close call: It seems to
549 // help nearly no benchmark on out-of-order architectures, on the other hand
550 // it regresses register pressure on a few benchmarking.
551 Policy.DisableLatencyHeuristic = DisableLatencySchedHeuristic;
552}
553
555 SUnit *Def, int DefOpIdx, SUnit *Use, int UseOpIdx, SDep &Dep,
556 const TargetSchedModel *SchedModel) const {
557 if (!SchedModel || Dep.getKind() != SDep::Kind::Data || !Dep.getReg() ||
558 !Def->isInstr() || !Use->isInstr() ||
559 (Def->getInstr()->getOpcode() != TargetOpcode::BUNDLE &&
560 Use->getInstr()->getOpcode() != TargetOpcode::BUNDLE))
561 return;
562
563 // If the Def is a BUNDLE, find the last instruction in the bundle that defs
564 // the register.
565 const MachineInstr *DefMI = Def->getInstr();
566 if (DefMI->getOpcode() == TargetOpcode::BUNDLE) {
567 Register Reg = DefMI->getOperand(DefOpIdx).getReg();
568 for (const auto &Op : const_mi_bundle_ops(*DefMI)) {
569 if (Op.isReg() && Op.isDef() && Op.getReg() == Reg) {
570 DefMI = Op.getParent();
571 DefOpIdx = Op.getOperandNo();
572 }
573 }
574 }
575
576 // If the Use is a BUNDLE, find the first instruction that uses the Reg.
577 const MachineInstr *UseMI = Use->getInstr();
578 if (UseMI->getOpcode() == TargetOpcode::BUNDLE) {
579 Register Reg = UseMI->getOperand(UseOpIdx).getReg();
580 for (const auto &Op : const_mi_bundle_ops(*UseMI)) {
581 if (Op.isReg() && Op.isUse() && Op.getReg() == Reg) {
582 UseMI = Op.getParent();
583 UseOpIdx = Op.getOperandNo();
584 break;
585 }
586 }
587 }
588
589 Dep.setLatency(
590 SchedModel->computeOperandLatency(DefMI, DefOpIdx, UseMI, UseOpIdx));
591}
592
596
599 return false;
600
601 if (TargetTriple.isDriverKit())
602 return true;
603 if (TargetTriple.isiOS()) {
604 return TargetTriple.getiOSVersion() >= VersionTuple(8);
605 }
606
607 return false;
608}
609
610std::unique_ptr<PBQPRAConstraint>
612 return balanceFPOps() ? std::make_unique<A57ChainingConstraint>() : nullptr;
613}
614
616 // We usually compute max call frame size after ISel. Do the computation now
617 // if the .mir file didn't specify it. Note that this will probably give you
618 // bogus values after PEI has eliminated the callframe setup/destroy pseudo
619 // instructions, specify explicitly if you need it to be correct.
620 MachineFrameInfo &MFI = MF.getFrameInfo();
623}
624
625bool AArch64Subtarget::useAA() const { return UseAA; }
626
628 // If SVE2 or SME is present (we are not SVE-1 only) and UseScalarIncVL
629 // is not otherwise set, enable it by default.
630 if (UseScalarIncVL.getNumOccurrences())
631 return UseScalarIncVL;
632 return hasSVE2() || hasSME();
633}
634
635// If return address signing is enabled, tail calls are emitted as follows:
636//
637// ```
638// <authenticate LR>
639// <check LR>
640// TCRETURN ; the callee may sign and spill the LR in its prologue
641// ```
642//
643// LR may require explicit checking because if FEAT_FPAC is not implemented
644// and LR was tampered with, then `<authenticate LR>` will not generate an
645// exception on its own. Later, if the callee spills the signed LR value and
646// neither FEAT_PAuth2 nor FEAT_EPAC are implemented, the valid PAC replaces
647// the higher bits of LR thus hiding the authentication failure.
649 const MachineFunction &MF) const {
650 // TODO: Check subtarget for the scheme. Present variant is a default for
651 // pauthtest ABI.
652 if (MF.getFunction().hasFnAttribute("ptrauth-returns") &&
653 MF.getFunction().hasFnAttribute("ptrauth-auth-traps"))
655 if (AuthenticatedLRCheckMethod.getNumOccurrences())
657
658 // At now, use None by default because checks may introduce an unexpected
659 // performance regression or incompatibility with execute-only mappings.
661}
662
663std::optional<uint16_t>
665 const Function &ParentFn) const {
666 if (!ParentFn.hasFnAttribute("ptrauth-indirect-gotos"))
667 return std::nullopt;
668 // We currently have one simple mechanism for all targets.
669 // This isn't ABI, so we can always do better in the future.
671 (Twine(ParentFn.getName()) + " blockaddress").str());
672}
673
675 // The Darwin kernel implements special protections for x16 and x17 so we
676 // should prefer to use those registers on that platform.
677 return isTargetDarwin();
678}
679
681 return getSchedModel().hasInstrSchedModel();
682}
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::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
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.
#define F(x, y, z)
Definition MD5.cpp:55
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
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.
AArch64InstrInfo InstrInfo
AArch64TargetLowering TLInfo
const RegisterBankInfo * getRegBankInfo() const override
std::unique_ptr< LegalizerInfo > Legalizer
std::unique_ptr< InlineAsmLowering > InlineAsmLoweringInfo
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition Function.cpp:727
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:19
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:278
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.
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)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
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:649
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)
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:548
LLVM_ABI uint16_t getPointerAuthStableSipHash(StringRef S)
Compute a stable non-zero 16-bit hash of the given string.
Definition SipHash.cpp:39
DWARFExpression::Operation Op
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:851
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.