LLVM 21.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(13), 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 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 switch (ARMProcFamily) {
226 case AppleA14:
227 case AppleA15:
228 case AppleA16:
229 case AppleA17:
230 case AppleM4:
232 break;
233 default:
234 break;
235 }
236 break;
237 case ExynosM3:
239 MaxJumpTableSize = 20;
242 break;
243 case Falkor:
245 // FIXME: remove this to enable 64-bit SLP if performance looks good.
247 CacheLineSize = 128;
248 PrefetchDistance = 820;
249 MinPrefetchStride = 2048;
251 break;
252 case Kryo:
255 CacheLineSize = 128;
256 PrefetchDistance = 740;
257 MinPrefetchStride = 1024;
259 // FIXME: remove this to enable 64-bit SLP if performance looks good.
261 break;
262 case NeoverseE1:
264 break;
265 case NeoverseN1:
269 break;
270 case NeoverseV2:
271 case NeoverseV3:
274 ScatterOverhead = 13;
276 case NeoverseN2:
277 case NeoverseN3:
281 VScaleForTuning = 1;
282 break;
283 case NeoverseV1:
287 VScaleForTuning = 2;
289 break;
290 case Neoverse512TVB:
292 VScaleForTuning = 1;
294 break;
295 case Saphira:
297 // FIXME: remove this to enable 64-bit SLP if performance looks good.
299 break;
300 case ThunderX2T99:
301 CacheLineSize = 64;
305 PrefetchDistance = 128;
306 MinPrefetchStride = 1024;
308 // FIXME: remove this to enable 64-bit SLP if performance looks good.
310 break;
311 case ThunderX:
312 case ThunderXT88:
313 case ThunderXT81:
314 case ThunderXT83:
315 CacheLineSize = 128;
318 // FIXME: remove this to enable 64-bit SLP if performance looks good.
320 break;
321 case TSV110:
322 CacheLineSize = 64;
325 break;
326 case ThunderX3T110:
327 CacheLineSize = 64;
331 PrefetchDistance = 128;
332 MinPrefetchStride = 1024;
334 // FIXME: remove this to enable 64-bit SLP if performance looks good.
336 break;
337 case Ampere1:
338 case Ampere1A:
339 case Ampere1B:
340 CacheLineSize = 64;
344 break;
345 case Oryon:
346 CacheLineSize = 64;
349 PrefetchDistance = 128;
350 MinPrefetchStride = 1024;
351 break;
352 }
353
354 if (AArch64MinimumJumpTableEntries.getNumOccurrences() > 0 || !HasMinSize)
356}
357
359 StringRef TuneCPU, StringRef FS,
360 const TargetMachine &TM, bool LittleEndian,
361 unsigned MinSVEVectorSizeInBitsOverride,
362 unsigned MaxSVEVectorSizeInBitsOverride,
363 bool IsStreaming, bool IsStreamingCompatible,
364 bool HasMinSize)
365 : AArch64GenSubtargetInfo(TT, CPU, TuneCPU, FS),
366 ReserveXRegister(AArch64::GPR64commonRegClass.getNumRegs()),
367 ReserveXRegisterForRA(AArch64::GPR64commonRegClass.getNumRegs()),
368 CustomCallSavedXRegs(AArch64::GPR64commonRegClass.getNumRegs()),
369 IsLittle(LittleEndian), IsStreaming(IsStreaming),
370 IsStreamingCompatible(IsStreamingCompatible),
371 StreamingHazardSize(
372 AArch64StreamingHazardSize.getNumOccurrences() > 0
374 : std::nullopt),
375 MinSVEVectorSizeInBits(MinSVEVectorSizeInBitsOverride),
376 MaxSVEVectorSizeInBits(MaxSVEVectorSizeInBitsOverride), TargetTriple(TT),
377 InstrInfo(initializeSubtargetDependencies(FS, CPU, TuneCPU, HasMinSize)),
378 TLInfo(TM, *this) {
381
384 Legalizer.reset(new AArch64LegalizerInfo(*this));
385
386 auto *RBI = new AArch64RegisterBankInfo(*getRegisterInfo());
387
388 // FIXME: At this point, we can't rely on Subtarget having RBI.
389 // It's awkward to mix passing RBI and the Subtarget; should we pass
390 // TII/TRI as well?
392 *static_cast<const AArch64TargetMachine *>(&TM), *this, *RBI));
393
394 RegBankInfo.reset(RBI);
395
396 auto TRI = getRegisterInfo();
397 StringSet<> ReservedRegNames;
398 ReservedRegNames.insert(ReservedRegsForRA.begin(), ReservedRegsForRA.end());
399 for (unsigned i = 0; i < 29; ++i) {
400 if (ReservedRegNames.count(TRI->getName(AArch64::X0 + i)))
402 }
403 // X30 is named LR, so we can't use TRI->getName to check X30.
404 if (ReservedRegNames.count("X30") || ReservedRegNames.count("LR"))
406 // X29 is named FP, so we can't use TRI->getName to check X29.
407 if (ReservedRegNames.count("X29") || ReservedRegNames.count("FP"))
409
411}
412
414 AArch64HwModeBits Modes = AArch64HwModeBits::DefaultMode;
415
416 // Use a special hardware mode in streaming[-compatible] functions with
417 // aarch64-enable-zpr-predicate-spills. This changes the spill size (and
418 // alignment) for the predicate register class.
421 Modes |= AArch64HwModeBits::SMEWithZPRPredicateSpills;
422 }
423
424 return to_underlying(Modes);
425}
426
428 return CallLoweringInfo.get();
429}
430
432 return InlineAsmLoweringInfo.get();
433}
434
436 return InstSelector.get();
437}
438
440 return Legalizer.get();
441}
442
444 return RegBankInfo.get();
445}
446
447/// Find the target operand flags that describe how a global value should be
448/// referenced for the current subtarget.
449unsigned
451 const TargetMachine &TM) const {
452 // MachO large model always goes via a GOT, simply to get a single 8-byte
453 // absolute relocation on all global addresses.
454 if (TM.getCodeModel() == CodeModel::Large && isTargetMachO())
455 return AArch64II::MO_GOT;
456
457 // All globals dynamically protected by MTE must have their address tags
458 // synthesized. This is done by having the loader stash the tag in the GOT
459 // entry. Force all tagged globals (even ones with internal linkage) through
460 // the GOT.
461 if (GV->isTagged())
462 return AArch64II::MO_GOT;
463
464 if (!TM.shouldAssumeDSOLocal(GV)) {
465 if (GV->hasDLLImportStorageClass()) {
467 }
468 if (getTargetTriple().isOSWindows())
470 return AArch64II::MO_GOT;
471 }
472
473 // The small code model's direct accesses use ADRP, which cannot
474 // necessarily produce the value 0 (if the code is above 4GB).
475 // Same for the tiny code model, where we have a pc relative LDR.
476 if ((useSmallAddressing() || TM.getCodeModel() == CodeModel::Tiny) &&
478 return AArch64II::MO_GOT;
479
480 // References to tagged globals are marked with MO_NC | MO_TAGGED to indicate
481 // that their nominal addresses are tagged and outside of the code model. In
482 // AArch64ExpandPseudo::expandMI we emit an additional instruction to set the
483 // tag if necessary based on MO_TAGGED.
484 if (AllowTaggedGlobals && !isa<FunctionType>(GV->getValueType()))
486
488}
489
491 const GlobalValue *GV, const TargetMachine &TM) const {
492 // MachO large model always goes via a GOT, because we don't have the
493 // relocations available to do anything else..
494 if (TM.getCodeModel() == CodeModel::Large && isTargetMachO() &&
495 !GV->hasInternalLinkage())
496 return AArch64II::MO_GOT;
497
498 // NonLazyBind goes via GOT unless we know it's available locally.
499 auto *F = dyn_cast<Function>(GV);
500 if ((!isTargetMachO() || MachOUseNonLazyBind) && F &&
501 F->hasFnAttribute(Attribute::NonLazyBind) && !TM.shouldAssumeDSOLocal(GV))
502 return AArch64II::MO_GOT;
503
504 if (getTargetTriple().isOSWindows()) {
505 if (isWindowsArm64EC() && GV->getValueType()->isFunctionTy()) {
506 if (GV->hasDLLImportStorageClass()) {
507 // On Arm64EC, if we're calling a symbol from the import table
508 // directly, use MO_ARM64EC_CALLMANGLE.
511 }
512 if (GV->hasExternalLinkage()) {
513 // If we're calling a symbol directly, use the mangled form in the
514 // call instruction.
516 }
517 }
518
519 // Use ClassifyGlobalReference for setting MO_DLLIMPORT/MO_COFFSTUB.
520 return ClassifyGlobalReference(GV, TM);
521 }
522
524}
525
527 unsigned NumRegionInstrs) const {
528 // LNT run (at least on Cyclone) showed reasonably significant gains for
529 // bi-directional scheduling. 253.perlbmk.
530 Policy.OnlyTopDown = false;
531 Policy.OnlyBottomUp = false;
532 // Enabling or Disabling the latency heuristic is a close call: It seems to
533 // help nearly no benchmark on out-of-order architectures, on the other hand
534 // it regresses register pressure on a few benchmarking.
535 Policy.DisableLatencyHeuristic = DisableLatencySchedHeuristic;
536}
537
539 SUnit *Def, int DefOpIdx, SUnit *Use, int UseOpIdx, SDep &Dep,
540 const TargetSchedModel *SchedModel) const {
541 if (!SchedModel || Dep.getKind() != SDep::Kind::Data || !Dep.getReg() ||
542 !Def->isInstr() || !Use->isInstr() ||
543 (Def->getInstr()->getOpcode() != TargetOpcode::BUNDLE &&
544 Use->getInstr()->getOpcode() != TargetOpcode::BUNDLE))
545 return;
546
547 // If the Def is a BUNDLE, find the last instruction in the bundle that defs
548 // the register.
549 const MachineInstr *DefMI = Def->getInstr();
550 if (DefMI->getOpcode() == TargetOpcode::BUNDLE) {
551 Register Reg = DefMI->getOperand(DefOpIdx).getReg();
552 for (const auto &Op : const_mi_bundle_ops(*DefMI)) {
553 if (Op.isReg() && Op.isDef() && Op.getReg() == Reg) {
554 DefMI = Op.getParent();
555 DefOpIdx = Op.getOperandNo();
556 }
557 }
558 }
559
560 // If the Use is a BUNDLE, find the first instruction that uses the Reg.
561 const MachineInstr *UseMI = Use->getInstr();
562 if (UseMI->getOpcode() == TargetOpcode::BUNDLE) {
563 Register Reg = UseMI->getOperand(UseOpIdx).getReg();
564 for (const auto &Op : const_mi_bundle_ops(*UseMI)) {
565 if (Op.isReg() && Op.isUse() && Op.getReg() == Reg) {
566 UseMI = Op.getParent();
567 UseOpIdx = Op.getOperandNo();
568 break;
569 }
570 }
571 }
572
573 Dep.setLatency(
574 SchedModel->computeOperandLatency(DefMI, DefOpIdx, UseMI, UseOpIdx));
575}
576
579}
580
583 return false;
584
586 return true;
587 if (TargetTriple.isiOS()) {
589 }
590
591 return false;
592}
593
594std::unique_ptr<PBQPRAConstraint>
596 return balanceFPOps() ? std::make_unique<A57ChainingConstraint>() : nullptr;
597}
598
600 // We usually compute max call frame size after ISel. Do the computation now
601 // if the .mir file didn't specify it. Note that this will probably give you
602 // bogus values after PEI has eliminated the callframe setup/destroy pseudo
603 // instructions, specify explicitly if you need it to be correct.
604 MachineFrameInfo &MFI = MF.getFrameInfo();
607}
608
609bool AArch64Subtarget::useAA() const { return UseAA; }
610
612 // If SVE2 or SME is present (we are not SVE-1 only) and UseScalarIncVL
613 // is not otherwise set, enable it by default.
615 return UseScalarIncVL;
616 return hasSVE2() || hasSME();
617}
618
619// If return address signing is enabled, tail calls are emitted as follows:
620//
621// ```
622// <authenticate LR>
623// <check LR>
624// TCRETURN ; the callee may sign and spill the LR in its prologue
625// ```
626//
627// LR may require explicit checking because if FEAT_FPAC is not implemented
628// and LR was tampered with, then `<authenticate LR>` will not generate an
629// exception on its own. Later, if the callee spills the signed LR value and
630// neither FEAT_PAuth2 nor FEAT_EPAC are implemented, the valid PAC replaces
631// the higher bits of LR thus hiding the authentication failure.
633 const MachineFunction &MF) const {
634 // TODO: Check subtarget for the scheme. Present variant is a default for
635 // pauthtest ABI.
636 if (MF.getFunction().hasFnAttribute("ptrauth-returns") &&
637 MF.getFunction().hasFnAttribute("ptrauth-auth-traps"))
639 if (AuthenticatedLRCheckMethod.getNumOccurrences())
641
642 // At now, use None by default because checks may introduce an unexpected
643 // performance regression or incompatibility with execute-only mappings.
645}
646
647std::optional<uint16_t>
649 const Function &ParentFn) const {
650 if (!ParentFn.hasFnAttribute("ptrauth-indirect-gotos"))
651 return std::nullopt;
652 // We currently have one simple mechanism for all targets.
653 // This isn't ABI, so we can always do better in the future.
655 (Twine(ParentFn.getName()) + " blockaddress").str());
656}
657
659 return getSchedModel().hasInstrSchedModel();
660}
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< bool > MachOUseNonLazyBind("aarch64-macho-enable-nonlazybind", cl::desc("Call nonlazybind functions via direct GOT load for Mach-O"), cl::Hidden)
static cl::opt< unsigned > AArch64MinimumJumpTableEntries("aarch64-min-jump-table-entries", cl::init(13), cl::Hidden, cl::desc("Set minimum number of entries to use a jump table on AArch64"))
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:388
#define F(x, y, z)
Definition: MD5.cpp:55
unsigned 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
void overrideSchedPolicy(MachineSchedPolicy &Policy, unsigned NumRegionInstrs) const override
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.
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.
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:731
bool hasExternalLinkage() const
Definition: GlobalValue.h:512
bool isTagged() const
Definition: GlobalValue.h:366
bool hasExternalWeakLinkage() const
Definition: GlobalValue.h:530
bool hasDLLImportStorageClass() const
Definition: GlobalValue.h:279
bool hasInternalLinkage() const
Definition: GlobalValue.h:527
Type * getValueType() const
Definition: GlobalValue.h:297
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
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:71
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
Definition: MachineInstr.h:577
const MachineOperand & getOperand(unsigned i) const
Definition: MachineInstr.h:587
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:49
Kind getKind() const
Returns an enum value representing the kind of the dependence.
Definition: ScheduleDAG.h:504
@ Data
Regular data dependence (aka true-dependence).
Definition: ScheduleDAG.h:53
void setLatency(unsigned Lat)
Sets the latency for this edge.
Definition: ScheduleDAG.h:147
unsigned getReg() const
Returns the register associated with this edge.
Definition: ScheduleDAG.h:218
Scheduling unit. This is a node in the scheduling DAG.
Definition: ScheduleDAG.h:242
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
Definition: StringMap.h:276
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:147
StringSet - A wrapper for StringMap that provides set-like functionality.
Definition: StringSet.h:23
std::pair< typename Base::iterator, bool > insert(StringRef key)
Definition: StringSet.h:38
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:81
Provide an instruction scheduling machine model to CodeGen passes.
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:44
bool isDriverKit() const
Is this an Apple DriverKit triple.
Definition: Triple.h:578
bool isiOS() const
Is this an iOS triple.
Definition: Triple.h:556
VersionTuple getiOSVersion() const
Parse the version number as with getOSVersion.
Definition: Triple.cpp:1472
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
bool isFunctionTy() const
True if this is an instance of FunctionType.
Definition: Type.h:255
A Use represents the edge between a Value definition and its users.
Definition: Use.h:35
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:309
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:29
int getNumOccurrences() const
Definition: CommandLine.h:399
DataType & getValue()
Definition: CommandLine.h:1352
@ 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.
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:711
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:443
@ CommaSeparated
Definition: CommandLine.h:163
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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)
uint16_t getPointerAuthStableSipHash(StringRef S)
Compute a stable non-zero 16-bit hash of the given string.
Definition: SipHash.cpp:168
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858
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.