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
128#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
129 bool ATTRIBUTE = DEFAULT;
130#include "ARMGenSubtargetInfo.inc"
212 bool MinSize =
false);
239 return InstrInfo.get();
247 return FrameLowering.get();
251 return &InstrInfo->getRegisterInfo();
262 std::unique_ptr<ARMFrameLowering> FrameLowering;
264 std::unique_ptr<ARMBaseInstrInfo> InstrInfo;
268 std::unique_ptr<CallLowering> CallLoweringInfo;
269 std::unique_ptr<InstructionSelector> InstSelector;
270 std::unique_ptr<LegalizerInfo>
Legalizer;
271 std::unique_ptr<RegisterBankInfo> RegBankInfo;
273 void initializeEnvironment();
277 std::bitset<8> CoprocCDE = {};
280#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
281 bool GETTER() const { return ATTRIBUTE; }
282#include "ARMGenSubtargetInfo.inc"
305 return hasNEON() && hasNEONForFP();
314 return HasDataBarrier || (hasV6Ops() && !
isThumb());
327 return hasThumb2() && hasDSP();
333 bool hasFusion()
const {
return hasFuseAES() || hasFuseLiterals(); }
386 return !(isReadTPTPIDRURW() || isReadTPTPIDRURO() || isReadTPTPIDRPRW());
410 return isTargetMachO() ? (ReserveR9 || !HasV6Ops) : ReserveR9;
457 bool useAA()
const override {
return true; }
526 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...
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
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
unsigned PreferBranchLogAlignment
What alignment is preferred for loop bodies and functions, in log2(bytes).
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...
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
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
unsigned getPreferBranchLogAlignment() const
const CallLowering * getCallLowering() const override
enum PushPopSplitVariation getPushPopSplitVariation(const MachineFunction &MF) const
ARMSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
initializeSubtargetDependencies - Initializes using a CPU and feature string so that we can use initi...
PushPopSplitVariation
How the push and pop instructions of callee saved general-purpose registers should be split.
@ SplitR11WindowsSEH
When the stack frame size is not known (because of variable-sized objects or realignment),...
@ SplitR7
R7 and LR must be adjacent, because R7 is the frame pointer, and must point to a frame record consist...
@ SplitR11AAPCSSignRA
When generating AAPCS-compilant frame chains, R11 is the frame pointer, and must be pushed adjacent t...
@ NoSplit
All GPRs can be pushed in a single instruction.
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.
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.
Holds all the information related to register banks.
StringRef - Represent a constant reference to a string, i.e.
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.