10b57cec5SDimitry Andric //===-- AArch64Subtarget.cpp - AArch64 Subtarget Information ----*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 90b57cec5SDimitry Andric // This file implements the AArch64 specific subclass of TargetSubtarget. 100b57cec5SDimitry Andric // 110b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric #include "AArch64Subtarget.h" 140b57cec5SDimitry Andric 150b57cec5SDimitry Andric #include "AArch64.h" 160b57cec5SDimitry Andric #include "AArch64InstrInfo.h" 170b57cec5SDimitry Andric #include "AArch64PBQPRegAlloc.h" 180b57cec5SDimitry Andric #include "AArch64TargetMachine.h" 195ffd83dbSDimitry Andric #include "GISel/AArch64CallLowering.h" 205ffd83dbSDimitry Andric #include "GISel/AArch64LegalizerInfo.h" 215ffd83dbSDimitry Andric #include "GISel/AArch64RegisterBankInfo.h" 220b57cec5SDimitry Andric #include "MCTargetDesc/AArch64AddressingModes.h" 230b57cec5SDimitry Andric #include "llvm/CodeGen/GlobalISel/InstructionSelect.h" 240b57cec5SDimitry Andric #include "llvm/CodeGen/MachineScheduler.h" 250b57cec5SDimitry Andric #include "llvm/IR/GlobalValue.h" 260b57cec5SDimitry Andric #include "llvm/Support/TargetParser.h" 270b57cec5SDimitry Andric 280b57cec5SDimitry Andric using namespace llvm; 290b57cec5SDimitry Andric 300b57cec5SDimitry Andric #define DEBUG_TYPE "aarch64-subtarget" 310b57cec5SDimitry Andric 320b57cec5SDimitry Andric #define GET_SUBTARGETINFO_CTOR 330b57cec5SDimitry Andric #define GET_SUBTARGETINFO_TARGET_DESC 340b57cec5SDimitry Andric #include "AArch64GenSubtargetInfo.inc" 350b57cec5SDimitry Andric 360b57cec5SDimitry Andric static cl::opt<bool> 370b57cec5SDimitry Andric EnableEarlyIfConvert("aarch64-early-ifcvt", cl::desc("Enable the early if " 380b57cec5SDimitry Andric "converter pass"), cl::init(true), cl::Hidden); 390b57cec5SDimitry Andric 400b57cec5SDimitry Andric // If OS supports TBI, use this flag to enable it. 410b57cec5SDimitry Andric static cl::opt<bool> 420b57cec5SDimitry Andric UseAddressTopByteIgnored("aarch64-use-tbi", cl::desc("Assume that top byte of " 430b57cec5SDimitry Andric "an address is ignored"), cl::init(false), cl::Hidden); 440b57cec5SDimitry Andric 450b57cec5SDimitry Andric static cl::opt<bool> 460b57cec5SDimitry Andric UseNonLazyBind("aarch64-enable-nonlazybind", 470b57cec5SDimitry Andric cl::desc("Call nonlazybind functions via direct GOT load"), 480b57cec5SDimitry Andric cl::init(false), cl::Hidden); 490b57cec5SDimitry Andric 50fe6060f1SDimitry Andric static cl::opt<bool> UseAA("aarch64-use-aa", cl::init(true), 51fe6060f1SDimitry Andric cl::desc("Enable the use of AA during codegen.")); 525ffd83dbSDimitry Andric 53349cc55cSDimitry Andric AArch64Subtarget &AArch64Subtarget::initializeSubtargetDependencies( 54349cc55cSDimitry Andric StringRef FS, StringRef CPUString, StringRef TuneCPUString) { 550b57cec5SDimitry Andric // Determine default and user-specified characteristics 560b57cec5SDimitry Andric 570b57cec5SDimitry Andric if (CPUString.empty()) 580b57cec5SDimitry Andric CPUString = "generic"; 590b57cec5SDimitry Andric 60349cc55cSDimitry Andric if (TuneCPUString.empty()) 61349cc55cSDimitry Andric TuneCPUString = CPUString; 62349cc55cSDimitry Andric 63349cc55cSDimitry Andric ParseSubtargetFeatures(CPUString, TuneCPUString, FS); 640b57cec5SDimitry Andric initializeProperties(); 650b57cec5SDimitry Andric 660b57cec5SDimitry Andric return *this; 670b57cec5SDimitry Andric } 680b57cec5SDimitry Andric 690b57cec5SDimitry Andric void AArch64Subtarget::initializeProperties() { 700b57cec5SDimitry Andric // Initialize CPU specific properties. We should add a tablegen feature for 710b57cec5SDimitry Andric // this in the future so we can specify it together with the subtarget 720b57cec5SDimitry Andric // features. 730b57cec5SDimitry Andric switch (ARMProcFamily) { 740b57cec5SDimitry Andric case Others: 750b57cec5SDimitry Andric break; 765ffd83dbSDimitry Andric case Carmel: 775ffd83dbSDimitry Andric CacheLineSize = 64; 785ffd83dbSDimitry Andric break; 790b57cec5SDimitry Andric case CortexA35: 800b57cec5SDimitry Andric break; 810b57cec5SDimitry Andric case CortexA53: 820b57cec5SDimitry Andric case CortexA55: 83fe6060f1SDimitry Andric PrefFunctionLogAlignment = 4; 840b57cec5SDimitry Andric break; 850b57cec5SDimitry Andric case CortexA57: 860b57cec5SDimitry Andric MaxInterleaveFactor = 4; 878bcb0991SDimitry Andric PrefFunctionLogAlignment = 4; 888bcb0991SDimitry Andric break; 898bcb0991SDimitry Andric case CortexA65: 908bcb0991SDimitry Andric PrefFunctionLogAlignment = 3; 910b57cec5SDimitry Andric break; 920b57cec5SDimitry Andric case CortexA72: 930b57cec5SDimitry Andric case CortexA73: 940b57cec5SDimitry Andric case CortexA75: 950b57cec5SDimitry Andric case CortexA76: 965ffd83dbSDimitry Andric case CortexA77: 975ffd83dbSDimitry Andric case CortexA78: 98e8d8bef9SDimitry Andric case CortexA78C: 99e8d8bef9SDimitry Andric case CortexR82: 1005ffd83dbSDimitry Andric case CortexX1: 1018bcb0991SDimitry Andric PrefFunctionLogAlignment = 4; 1020b57cec5SDimitry Andric break; 103349cc55cSDimitry Andric case CortexA510: 104349cc55cSDimitry Andric case CortexA710: 105349cc55cSDimitry Andric case CortexX2: 106349cc55cSDimitry Andric PrefFunctionLogAlignment = 4; 107349cc55cSDimitry Andric VScaleForTuning = 1; 108349cc55cSDimitry Andric break; 1095ffd83dbSDimitry Andric case A64FX: 1105ffd83dbSDimitry Andric CacheLineSize = 256; 111e8d8bef9SDimitry Andric PrefFunctionLogAlignment = 3; 112e8d8bef9SDimitry Andric PrefLoopLogAlignment = 2; 113e8d8bef9SDimitry Andric MaxInterleaveFactor = 4; 114e8d8bef9SDimitry Andric PrefetchDistance = 128; 115e8d8bef9SDimitry Andric MinPrefetchStride = 1024; 116e8d8bef9SDimitry Andric MaxPrefetchIterationsAhead = 4; 117349cc55cSDimitry Andric VScaleForTuning = 4; 1185ffd83dbSDimitry Andric break; 119480093f4SDimitry Andric case AppleA7: 120480093f4SDimitry Andric case AppleA10: 121480093f4SDimitry Andric case AppleA11: 122480093f4SDimitry Andric case AppleA12: 123480093f4SDimitry Andric case AppleA13: 124e8d8bef9SDimitry Andric case AppleA14: 1250b57cec5SDimitry Andric CacheLineSize = 64; 1260b57cec5SDimitry Andric PrefetchDistance = 280; 1270b57cec5SDimitry Andric MinPrefetchStride = 2048; 1280b57cec5SDimitry Andric MaxPrefetchIterationsAhead = 3; 1290b57cec5SDimitry Andric break; 1300b57cec5SDimitry Andric case ExynosM3: 1310b57cec5SDimitry Andric MaxInterleaveFactor = 4; 1320b57cec5SDimitry Andric MaxJumpTableSize = 20; 1338bcb0991SDimitry Andric PrefFunctionLogAlignment = 5; 1348bcb0991SDimitry Andric PrefLoopLogAlignment = 4; 1350b57cec5SDimitry Andric break; 1360b57cec5SDimitry Andric case Falkor: 1370b57cec5SDimitry Andric MaxInterleaveFactor = 4; 1380b57cec5SDimitry Andric // FIXME: remove this to enable 64-bit SLP if performance looks good. 1390b57cec5SDimitry Andric MinVectorRegisterBitWidth = 128; 1400b57cec5SDimitry Andric CacheLineSize = 128; 1410b57cec5SDimitry Andric PrefetchDistance = 820; 1420b57cec5SDimitry Andric MinPrefetchStride = 2048; 1430b57cec5SDimitry Andric MaxPrefetchIterationsAhead = 8; 1440b57cec5SDimitry Andric break; 1450b57cec5SDimitry Andric case Kryo: 1460b57cec5SDimitry Andric MaxInterleaveFactor = 4; 1470b57cec5SDimitry Andric VectorInsertExtractBaseCost = 2; 1480b57cec5SDimitry Andric CacheLineSize = 128; 1490b57cec5SDimitry Andric PrefetchDistance = 740; 1500b57cec5SDimitry Andric MinPrefetchStride = 1024; 1510b57cec5SDimitry Andric MaxPrefetchIterationsAhead = 11; 1520b57cec5SDimitry Andric // FIXME: remove this to enable 64-bit SLP if performance looks good. 1530b57cec5SDimitry Andric MinVectorRegisterBitWidth = 128; 1540b57cec5SDimitry Andric break; 1558bcb0991SDimitry Andric case NeoverseE1: 1568bcb0991SDimitry Andric PrefFunctionLogAlignment = 3; 1578bcb0991SDimitry Andric break; 1588bcb0991SDimitry Andric case NeoverseN1: 159349cc55cSDimitry Andric PrefFunctionLogAlignment = 4; 160349cc55cSDimitry Andric break; 161e8d8bef9SDimitry Andric case NeoverseN2: 162349cc55cSDimitry Andric PrefFunctionLogAlignment = 4; 163349cc55cSDimitry Andric VScaleForTuning = 1; 164349cc55cSDimitry Andric break; 165e8d8bef9SDimitry Andric case NeoverseV1: 1668bcb0991SDimitry Andric PrefFunctionLogAlignment = 4; 167349cc55cSDimitry Andric VScaleForTuning = 2; 168349cc55cSDimitry Andric break; 169349cc55cSDimitry Andric case Neoverse512TVB: 170349cc55cSDimitry Andric PrefFunctionLogAlignment = 4; 171349cc55cSDimitry Andric VScaleForTuning = 1; 172349cc55cSDimitry Andric MaxInterleaveFactor = 4; 1738bcb0991SDimitry Andric break; 1740b57cec5SDimitry Andric case Saphira: 1750b57cec5SDimitry Andric MaxInterleaveFactor = 4; 1760b57cec5SDimitry Andric // FIXME: remove this to enable 64-bit SLP if performance looks good. 1770b57cec5SDimitry Andric MinVectorRegisterBitWidth = 128; 1780b57cec5SDimitry Andric break; 1790b57cec5SDimitry Andric case ThunderX2T99: 1800b57cec5SDimitry Andric CacheLineSize = 64; 1818bcb0991SDimitry Andric PrefFunctionLogAlignment = 3; 1828bcb0991SDimitry Andric PrefLoopLogAlignment = 2; 1830b57cec5SDimitry Andric MaxInterleaveFactor = 4; 1840b57cec5SDimitry Andric PrefetchDistance = 128; 1850b57cec5SDimitry Andric MinPrefetchStride = 1024; 1860b57cec5SDimitry Andric MaxPrefetchIterationsAhead = 4; 1870b57cec5SDimitry Andric // FIXME: remove this to enable 64-bit SLP if performance looks good. 1880b57cec5SDimitry Andric MinVectorRegisterBitWidth = 128; 1890b57cec5SDimitry Andric break; 1900b57cec5SDimitry Andric case ThunderX: 1910b57cec5SDimitry Andric case ThunderXT88: 1920b57cec5SDimitry Andric case ThunderXT81: 1930b57cec5SDimitry Andric case ThunderXT83: 1940b57cec5SDimitry Andric CacheLineSize = 128; 1958bcb0991SDimitry Andric PrefFunctionLogAlignment = 3; 1968bcb0991SDimitry Andric PrefLoopLogAlignment = 2; 1970b57cec5SDimitry Andric // FIXME: remove this to enable 64-bit SLP if performance looks good. 1980b57cec5SDimitry Andric MinVectorRegisterBitWidth = 128; 1990b57cec5SDimitry Andric break; 2000b57cec5SDimitry Andric case TSV110: 2010b57cec5SDimitry Andric CacheLineSize = 64; 2028bcb0991SDimitry Andric PrefFunctionLogAlignment = 4; 2038bcb0991SDimitry Andric PrefLoopLogAlignment = 2; 2040b57cec5SDimitry Andric break; 205e837bb5cSDimitry Andric case ThunderX3T110: 206e837bb5cSDimitry Andric CacheLineSize = 64; 207e837bb5cSDimitry Andric PrefFunctionLogAlignment = 4; 208e837bb5cSDimitry Andric PrefLoopLogAlignment = 2; 209e837bb5cSDimitry Andric MaxInterleaveFactor = 4; 210e837bb5cSDimitry Andric PrefetchDistance = 128; 211e837bb5cSDimitry Andric MinPrefetchStride = 1024; 212e837bb5cSDimitry Andric MaxPrefetchIterationsAhead = 4; 213e837bb5cSDimitry Andric // FIXME: remove this to enable 64-bit SLP if performance looks good. 214e837bb5cSDimitry Andric MinVectorRegisterBitWidth = 128; 215e837bb5cSDimitry Andric break; 2160b57cec5SDimitry Andric } 2170b57cec5SDimitry Andric } 2180b57cec5SDimitry Andric 2190b57cec5SDimitry Andric AArch64Subtarget::AArch64Subtarget(const Triple &TT, const std::string &CPU, 220349cc55cSDimitry Andric const std::string &TuneCPU, 2210b57cec5SDimitry Andric const std::string &FS, 222fe6060f1SDimitry Andric const TargetMachine &TM, bool LittleEndian, 223fe6060f1SDimitry Andric unsigned MinSVEVectorSizeInBitsOverride, 224fe6060f1SDimitry Andric unsigned MaxSVEVectorSizeInBitsOverride) 225349cc55cSDimitry Andric : AArch64GenSubtargetInfo(TT, CPU, TuneCPU, FS), 2260b57cec5SDimitry Andric ReserveXRegister(AArch64::GPR64commonRegClass.getNumRegs()), 2270b57cec5SDimitry Andric CustomCallSavedXRegs(AArch64::GPR64commonRegClass.getNumRegs()), 2280b57cec5SDimitry Andric IsLittle(LittleEndian), 229fe6060f1SDimitry Andric MinSVEVectorSizeInBits(MinSVEVectorSizeInBitsOverride), 230fe6060f1SDimitry Andric MaxSVEVectorSizeInBits(MaxSVEVectorSizeInBitsOverride), TargetTriple(TT), 231349cc55cSDimitry Andric FrameLowering(), 232349cc55cSDimitry Andric InstrInfo(initializeSubtargetDependencies(FS, CPU, TuneCPU)), TSInfo(), 233349cc55cSDimitry Andric TLInfo(TM, *this) { 2340b57cec5SDimitry Andric if (AArch64::isX18ReservedByDefault(TT)) 2350b57cec5SDimitry Andric ReserveXRegister.set(18); 2360b57cec5SDimitry Andric 2370b57cec5SDimitry Andric CallLoweringInfo.reset(new AArch64CallLowering(*getTargetLowering())); 2385ffd83dbSDimitry Andric InlineAsmLoweringInfo.reset(new InlineAsmLowering(getTargetLowering())); 2390b57cec5SDimitry Andric Legalizer.reset(new AArch64LegalizerInfo(*this)); 2400b57cec5SDimitry Andric 2410b57cec5SDimitry Andric auto *RBI = new AArch64RegisterBankInfo(*getRegisterInfo()); 2420b57cec5SDimitry Andric 2430b57cec5SDimitry Andric // FIXME: At this point, we can't rely on Subtarget having RBI. 2440b57cec5SDimitry Andric // It's awkward to mix passing RBI and the Subtarget; should we pass 2450b57cec5SDimitry Andric // TII/TRI as well? 2460b57cec5SDimitry Andric InstSelector.reset(createAArch64InstructionSelector( 2470b57cec5SDimitry Andric *static_cast<const AArch64TargetMachine *>(&TM), *this, *RBI)); 2480b57cec5SDimitry Andric 2490b57cec5SDimitry Andric RegBankInfo.reset(RBI); 2500b57cec5SDimitry Andric } 2510b57cec5SDimitry Andric 2520b57cec5SDimitry Andric const CallLowering *AArch64Subtarget::getCallLowering() const { 2530b57cec5SDimitry Andric return CallLoweringInfo.get(); 2540b57cec5SDimitry Andric } 2550b57cec5SDimitry Andric 2565ffd83dbSDimitry Andric const InlineAsmLowering *AArch64Subtarget::getInlineAsmLowering() const { 2575ffd83dbSDimitry Andric return InlineAsmLoweringInfo.get(); 2585ffd83dbSDimitry Andric } 2595ffd83dbSDimitry Andric 2608bcb0991SDimitry Andric InstructionSelector *AArch64Subtarget::getInstructionSelector() const { 2610b57cec5SDimitry Andric return InstSelector.get(); 2620b57cec5SDimitry Andric } 2630b57cec5SDimitry Andric 2640b57cec5SDimitry Andric const LegalizerInfo *AArch64Subtarget::getLegalizerInfo() const { 2650b57cec5SDimitry Andric return Legalizer.get(); 2660b57cec5SDimitry Andric } 2670b57cec5SDimitry Andric 2680b57cec5SDimitry Andric const RegisterBankInfo *AArch64Subtarget::getRegBankInfo() const { 2690b57cec5SDimitry Andric return RegBankInfo.get(); 2700b57cec5SDimitry Andric } 2710b57cec5SDimitry Andric 2720b57cec5SDimitry Andric /// Find the target operand flags that describe how a global value should be 2730b57cec5SDimitry Andric /// referenced for the current subtarget. 2748bcb0991SDimitry Andric unsigned 2750b57cec5SDimitry Andric AArch64Subtarget::ClassifyGlobalReference(const GlobalValue *GV, 2760b57cec5SDimitry Andric const TargetMachine &TM) const { 2770b57cec5SDimitry Andric // MachO large model always goes via a GOT, simply to get a single 8-byte 2780b57cec5SDimitry Andric // absolute relocation on all global addresses. 2790b57cec5SDimitry Andric if (TM.getCodeModel() == CodeModel::Large && isTargetMachO()) 2800b57cec5SDimitry Andric return AArch64II::MO_GOT; 2810b57cec5SDimitry Andric 2820b57cec5SDimitry Andric if (!TM.shouldAssumeDSOLocal(*GV->getParent(), GV)) { 2830b57cec5SDimitry Andric if (GV->hasDLLImportStorageClass()) 2840b57cec5SDimitry Andric return AArch64II::MO_GOT | AArch64II::MO_DLLIMPORT; 2850b57cec5SDimitry Andric if (getTargetTriple().isOSWindows()) 2860b57cec5SDimitry Andric return AArch64II::MO_GOT | AArch64II::MO_COFFSTUB; 2870b57cec5SDimitry Andric return AArch64II::MO_GOT; 2880b57cec5SDimitry Andric } 2890b57cec5SDimitry Andric 2900b57cec5SDimitry Andric // The small code model's direct accesses use ADRP, which cannot 2910b57cec5SDimitry Andric // necessarily produce the value 0 (if the code is above 4GB). 2920b57cec5SDimitry Andric // Same for the tiny code model, where we have a pc relative LDR. 2930b57cec5SDimitry Andric if ((useSmallAddressing() || TM.getCodeModel() == CodeModel::Tiny) && 2940b57cec5SDimitry Andric GV->hasExternalWeakLinkage()) 2950b57cec5SDimitry Andric return AArch64II::MO_GOT; 2960b57cec5SDimitry Andric 2978bcb0991SDimitry Andric // References to tagged globals are marked with MO_NC | MO_TAGGED to indicate 2988bcb0991SDimitry Andric // that their nominal addresses are tagged and outside of the code model. In 2998bcb0991SDimitry Andric // AArch64ExpandPseudo::expandMI we emit an additional instruction to set the 3008bcb0991SDimitry Andric // tag if necessary based on MO_TAGGED. 3018bcb0991SDimitry Andric if (AllowTaggedGlobals && !isa<FunctionType>(GV->getValueType())) 3028bcb0991SDimitry Andric return AArch64II::MO_NC | AArch64II::MO_TAGGED; 3038bcb0991SDimitry Andric 3040b57cec5SDimitry Andric return AArch64II::MO_NO_FLAG; 3050b57cec5SDimitry Andric } 3060b57cec5SDimitry Andric 3078bcb0991SDimitry Andric unsigned AArch64Subtarget::classifyGlobalFunctionReference( 3080b57cec5SDimitry Andric const GlobalValue *GV, const TargetMachine &TM) const { 3090b57cec5SDimitry Andric // MachO large model always goes via a GOT, because we don't have the 3100b57cec5SDimitry Andric // relocations available to do anything else.. 3110b57cec5SDimitry Andric if (TM.getCodeModel() == CodeModel::Large && isTargetMachO() && 3120b57cec5SDimitry Andric !GV->hasInternalLinkage()) 3130b57cec5SDimitry Andric return AArch64II::MO_GOT; 3140b57cec5SDimitry Andric 3150b57cec5SDimitry Andric // NonLazyBind goes via GOT unless we know it's available locally. 3160b57cec5SDimitry Andric auto *F = dyn_cast<Function>(GV); 3170b57cec5SDimitry Andric if (UseNonLazyBind && F && F->hasFnAttribute(Attribute::NonLazyBind) && 3180b57cec5SDimitry Andric !TM.shouldAssumeDSOLocal(*GV->getParent(), GV)) 3190b57cec5SDimitry Andric return AArch64II::MO_GOT; 3200b57cec5SDimitry Andric 321480093f4SDimitry Andric // Use ClassifyGlobalReference for setting MO_DLLIMPORT/MO_COFFSTUB. 322480093f4SDimitry Andric if (getTargetTriple().isOSWindows()) 323480093f4SDimitry Andric return ClassifyGlobalReference(GV, TM); 324480093f4SDimitry Andric 3250b57cec5SDimitry Andric return AArch64II::MO_NO_FLAG; 3260b57cec5SDimitry Andric } 3270b57cec5SDimitry Andric 3280b57cec5SDimitry Andric void AArch64Subtarget::overrideSchedPolicy(MachineSchedPolicy &Policy, 3290b57cec5SDimitry Andric unsigned NumRegionInstrs) const { 3300b57cec5SDimitry Andric // LNT run (at least on Cyclone) showed reasonably significant gains for 3310b57cec5SDimitry Andric // bi-directional scheduling. 253.perlbmk. 3320b57cec5SDimitry Andric Policy.OnlyTopDown = false; 3330b57cec5SDimitry Andric Policy.OnlyBottomUp = false; 3340b57cec5SDimitry Andric // Enabling or Disabling the latency heuristic is a close call: It seems to 3350b57cec5SDimitry Andric // help nearly no benchmark on out-of-order architectures, on the other hand 3360b57cec5SDimitry Andric // it regresses register pressure on a few benchmarking. 3370b57cec5SDimitry Andric Policy.DisableLatencyHeuristic = DisableLatencySchedHeuristic; 3380b57cec5SDimitry Andric } 3390b57cec5SDimitry Andric 3400b57cec5SDimitry Andric bool AArch64Subtarget::enableEarlyIfConversion() const { 3410b57cec5SDimitry Andric return EnableEarlyIfConvert; 3420b57cec5SDimitry Andric } 3430b57cec5SDimitry Andric 3440b57cec5SDimitry Andric bool AArch64Subtarget::supportsAddressTopByteIgnored() const { 3450b57cec5SDimitry Andric if (!UseAddressTopByteIgnored) 3460b57cec5SDimitry Andric return false; 3470b57cec5SDimitry Andric 3480b57cec5SDimitry Andric if (TargetTriple.isiOS()) { 349*0eae32dcSDimitry Andric return TargetTriple.getiOSVersion() >= VersionTuple(8); 3500b57cec5SDimitry Andric } 3510b57cec5SDimitry Andric 3520b57cec5SDimitry Andric return false; 3530b57cec5SDimitry Andric } 3540b57cec5SDimitry Andric 3550b57cec5SDimitry Andric std::unique_ptr<PBQPRAConstraint> 3560b57cec5SDimitry Andric AArch64Subtarget::getCustomPBQPConstraints() const { 3578bcb0991SDimitry Andric return balanceFPOps() ? std::make_unique<A57ChainingConstraint>() : nullptr; 3580b57cec5SDimitry Andric } 3590b57cec5SDimitry Andric 3600b57cec5SDimitry Andric void AArch64Subtarget::mirFileLoaded(MachineFunction &MF) const { 3610b57cec5SDimitry Andric // We usually compute max call frame size after ISel. Do the computation now 3620b57cec5SDimitry Andric // if the .mir file didn't specify it. Note that this will probably give you 3630b57cec5SDimitry Andric // bogus values after PEI has eliminated the callframe setup/destroy pseudo 3640b57cec5SDimitry Andric // instructions, specify explicitly if you need it to be correct. 3650b57cec5SDimitry Andric MachineFrameInfo &MFI = MF.getFrameInfo(); 3660b57cec5SDimitry Andric if (!MFI.isMaxCallFrameSizeComputed()) 3670b57cec5SDimitry Andric MFI.computeMaxCallFrameSize(MF); 3680b57cec5SDimitry Andric } 3695ffd83dbSDimitry Andric 370e8d8bef9SDimitry Andric bool AArch64Subtarget::useSVEForFixedLengthVectors() const { 371e8d8bef9SDimitry Andric // Prefer NEON unless larger SVE registers are available. 372e8d8bef9SDimitry Andric return hasSVE() && getMinSVEVectorSizeInBits() >= 256; 373e8d8bef9SDimitry Andric } 374fe6060f1SDimitry Andric 375fe6060f1SDimitry Andric bool AArch64Subtarget::useAA() const { return UseAA; } 376