13#ifndef LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H
14#define LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H
39#define GET_SUBTARGETINFO_HEADER
40#include "ARMGenSubtargetInfo.inc"
44class ARMBaseTargetMachine;
52#define ARM_PROCESSOR_FAMILY(ENUM) ENUM,
53#include "llvm/TargetParser/ARMTargetParserDef.inc"
54#undef ARM_PROCESSOR_FAMILY
64#define ARM_ARCHITECTURE(ENUM) ENUM,
65#include "llvm/TargetParser/ARMTargetParserDef.inc"
66#undef ARM_ARCHITECTURE
86#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
87 bool ATTRIBUTE = DEFAULT;
88#include "ARMGenSubtargetInfo.inc"
170 bool MinSize =
false);
197 return InstrInfo.get();
205 return FrameLowering.get();
209 return &InstrInfo->getRegisterInfo();
227 std::unique_ptr<ARMFrameLowering> FrameLowering;
229 std::unique_ptr<ARMBaseInstrInfo> InstrInfo;
233 std::unique_ptr<CallLowering> CallLoweringInfo;
234 std::unique_ptr<InstructionSelector> InstSelector;
235 std::unique_ptr<LegalizerInfo>
Legalizer;
236 std::unique_ptr<RegisterBankInfo> RegBankInfo;
238 void initializeEnvironment();
242 std::bitset<8> CoprocCDE = {};
245#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
246 bool GETTER() const { return ATTRIBUTE; }
247#include "ARMGenSubtargetInfo.inc"
268 return hasNEON() && hasNEONForFP();
277 return HasDataBarrier || (hasV6Ops() && !
isThumb());
290 return hasThumb2() && hasDSP();
296 bool hasFusion()
const {
return hasFuseAES() || hasFuseLiterals(); }
347 return !(isReadTPTPIDRURW() || isReadTPTPIDRURO() || isReadTPTPIDRPRW());
371 return isTargetMachO() ? (ReserveR9 || !HasV6Ops) : ReserveR9;
429 bool useAA()
const override {
return true; }
496 unsigned PhysReg)
const override;
static bool isThumb(const MCSubtargetInfo &STI)
This file describes how to lower LLVM calls to machine code calls.
static cl::opt< TargetTransformInfo::TargetCostKind > CostKind("cost-kind", cl::desc("Target cost kind"), cl::init(TargetTransformInfo::TCK_RecipThroughput), cl::values(clEnumValN(TargetTransformInfo::TCK_RecipThroughput, "throughput", "Reciprocal throughput"), clEnumValN(TargetTransformInfo::TCK_Latency, "latency", "Instruction latency"), clEnumValN(TargetTransformInfo::TCK_CodeSize, "code-size", "Code size"), clEnumValN(TargetTransformInfo::TCK_SizeAndLatency, "size-latency", "Code size and latency")))
Interface for Targets to specify which operations they can successfully select and how the others sho...
ARMFunctionInfo - This class is derived from MachineFunctionInfo and contains private ARM-specific in...
bool shouldSignReturnAddress() const
bool useFastISel() const
True if fast-isel is used.
bool isTargetMachO() const
bool hasFusion() const
Return true if the CPU supports any kind of instruction fusion.
bool IsLittle
IsLittle - The target is Little Endian.
bool isTargetAEABI() const
bool enablePostRAScheduler() const override
True for some subtargets at > -O0.
ARMLdStMultipleTiming LdStMultipleTiming
What kind of timing do load multiple/store multiple have (double issue, single issue etc).
bool supportsTailCall() const
bool supportsInitUndef() const override
The correct instructions have been implemented to initialize undef registers, therefore the ARM Archi...
const Triple & getTargetTriple() const
bool UseSjLjEH
UseSjLjEH - If true, the target uses SjLj exception handling (e.g. iOS).
unsigned getGPRAllocationOrder(const MachineFunction &MF) const
const RegisterBankInfo * getRegBankInfo() const override
unsigned MaxInterleaveFactor
const ARMBaseTargetMachine & TM
ARMLdStMultipleTiming getLdStMultipleTiming() const
const ARMBaseInstrInfo * getInstrInfo() const override
bool isThumb1Only() const
ARMProcFamilyEnum ARMProcFamily
ARMProcFamily - ARM processor family: Cortex-A8, Cortex-A9, and others.
ARMArchEnum ARMArch
ARMArch - ARM architecture.
bool hasFPARMv8Base() const
bool useDFAforSMS() const override
bool isReadTPSoft() const
ARMProcClassEnum ARMProcClass
ARMProcClass - ARM processor class: None, AClass, RClass or MClass.
bool ignoreCSRForAllocationOrder(const MachineFunction &MF, unsigned PhysReg) const override
bool isAAPCS16_ABI() const
MCPhysReg getFramePointerReg() const
bool isTargetWindows() const
bool isTargetEHABICompatible() const
bool enableSubRegLiveness() const override
Check whether this subtarget wants to use subregister liveness.
bool isGVIndirectSymbol(const GlobalValue *GV) const
True if the GV will be accessed via an indirect symbol.
unsigned MVEVectorCostFactor
The cost factor for MVE instructions, representing the multiple beats an.
const ARMTargetLowering * getTargetLowering() const override
MCSchedModel SchedModel
SchedModel - Processor specific instruction costs.
std::string CPUString
CPUString - String name of used CPU.
unsigned getMispredictionPenalty() const
Triple TargetTriple
TargetTriple - What processor and OS we're targeting.
bool enableMachineScheduler() const override
Returns true if machine scheduler should be enabled.
bool isTargetDarwin() const
const ARMBaseRegisterInfo * getRegisterInfo() const override
InstrItineraryData InstrItins
Selected instruction itineraries (one entry per itinerary class.)
bool useStride4VFPs() const
bool OptMinSize
OptMinSize - True if we're optimising for minimum code size, equal to the function attribute.
unsigned getReturnOpcode() const
Returns the correct return opcode for the current feature set.
bool RestrictIT
RestrictIT - If true, the subtarget disallows generation of complex IT blocks.
Align getStackAlignment() const
getStackAlignment - Returns the minimum alignment known to hold of the stack frame on entry to the fu...
unsigned PrefLoopLogAlignment
What alignment is preferred for loop bodies and functions, in log2(bytes).
bool useAA() const override
Enable use of alias analysis during code generation (during MI scheduling, DAGCombine,...
bool isTargetAndroid() const
Align stackAlignment
stackAlignment - The minimum alignment known to hold of the stack frame on entry to the function and ...
unsigned getMaxMemcpyTPInlineSizeThreshold() const
getMaxMemcpyTPInlineSizeThreshold - Returns the maximum size that still makes it profitable to inline...
unsigned PartialUpdateClearance
Clearance before partial register updates (in number of instructions)
bool enableMachinePipeliner() const override
Returns true if machine pipeliner should be enabled.
bool enablePostRAMachineScheduler() const override
True for some subtargets at > -O0.
bool isTargetCOFF() const
bool splitFramePushPop(const MachineFunction &MF) const
Returns true if the frame setup is split into two separate pushes (first r0-r7,lr then r8-r11),...
unsigned getMaxInlineSizeThreshold() const
getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size that still makes it profitable t...
bool isTargetGNUAEABI() const
const ARMSelectionDAGInfo * getSelectionDAGInfo() const override
const std::string & getCPUString() const
InstructionSelector * getInstructionSelector() const override
unsigned getMaxInterleaveFactor() const
bool isR9Reserved() const
unsigned getPartialUpdateClearance() const
bool isTargetNetBSD() const
bool isTargetWatchOS() const
bool isXRaySupported() const override
const CallLowering * getCallLowering() const override
bool splitFramePointerPush(const MachineFunction &MF) const
ARMSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
initializeSubtargetDependencies - Initializes using a CPU and feature string so that we can use initi...
bool isGVInGOT(const GlobalValue *GV) const
Returns the constant pool modifier needed to access the GV.
bool useNEONForSinglePrecisionFP() const
bool isTargetNaCl() const
const InstrItineraryData * getInstrItineraryData() const override
getInstrItins - Return the instruction itineraries based on subtarget selection.
bool isTargetWatchABI() const
bool allowPositionIndependentMovt() const
Allow movt+movw for PIC global address calculation.
bool UseMulOps
UseMulOps - True if non-microcoded fused integer multiply-add and multiply-subtract instructions shou...
const TargetOptions & Options
Options passed via command line that could influence the target.
ARMLdStMultipleTiming
What kind of timing do load multiple/store multiple instructions have.
@ DoubleIssueCheckUnalignedAccess
Can load/store 2 registers/cycle, but needs an extra cycle if the access is not 64-bit aligned.
@ SingleIssue
Can load/store 1 register/cycle.
@ DoubleIssue
Can load/store 2 registers/cycle.
@ SingleIssuePlusExtras
Can load/store 1 register/cycle, but needs an extra cycle for address computation and potentially als...
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool hasAnyDataBarrier() const
bool useMachinePipeliner() const
bool isTargetDriverKit() const
int getPreISelOperandLatencyAdjustment() const
bool useMachineScheduler() const
bool allowsUnalignedMem() const
bool isTargetMuslAEABI() const
const LegalizerInfo * getLegalizerInfo() const override
bool isTargetLinux() const
bool SupportsTailCall
SupportsTailCall - True if the OS supports tail call.
unsigned getPrefLoopLogAlignment() const
int PreISelOperandLatencyAdjustment
The adjustment that we need to apply to get the operand latency from the operand cycle returned by th...
bool isTargetHardFloat() const
unsigned getMVEVectorCostFactor(TargetTransformInfo::TargetCostKind CostKind) const
const ARMFrameLowering * getFrameLowering() const override
Align getDualLoadStoreAlignment() const
Itinerary data supplied by a subtarget to be used by a target.
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Holds all the information related to register banks.
StringRef - Represent a constant reference to a string, i.e.
bool DisableFramePointerElim(const MachineFunction &MF) const
DisableFramePointerElim - This returns true if frame pointer elimination optimization should be disab...
Triple - Helper class for working with autoconf configuration names.
bool isOSNaCl() const
Tests whether the OS is NaCl (Native Client)
bool isDriverKit() const
Is this an Apple DriverKit triple.
bool isTargetEHABICompatible() const
Tests whether the target supports the EHABI exception handling standard.
bool isAndroid() const
Tests whether the target is Android.
bool isOSBinFormatMachO() const
Tests whether the environment is MachO.
bool isOSBinFormatCOFF() const
Tests whether the OS uses the COFF binary format.
EnvironmentType getEnvironment() const
Get the parsed environment type of this triple.
bool isOSWindows() const
Tests whether the OS is Windows.
bool isOSLinux() const
Tests whether the OS is Linux.
bool isOSDarwin() const
Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, XROS, or DriverKit).
bool isWatchOS() const
Is this an Apple watchOS triple.
bool isiOS() const
Is this an iOS triple.
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
@ Swift
Calling convention for Swift.
This is an optimization pass for GlobalISel generic memory operations.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Machine model for scheduling, bundling, and heuristics.