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"
242 return InstrInfo.get();
250 return FrameLowering.get();
254 return &InstrInfo->getRegisterInfo();
265 std::unique_ptr<ARMFrameLowering> FrameLowering;
267 std::unique_ptr<ARMBaseInstrInfo> InstrInfo;
271 std::unique_ptr<CallLowering> CallLoweringInfo;
272 std::unique_ptr<InstructionSelector> InstSelector;
273 std::unique_ptr<LegalizerInfo>
Legalizer;
274 std::unique_ptr<RegisterBankInfo> RegBankInfo;
279 std::bitset<8> CoprocCDE = {};
282#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
283 bool GETTER() const { return ATTRIBUTE; }
284#include "ARMGenSubtargetInfo.inc"
307 return hasNEON() && hasNEONForFP();
316 return HasDataBarrier || (hasV6Ops() && !
isThumb());
328 return hasThumb2() && hasDSP();
334 bool hasFusion()
const {
return hasFuseAES() || hasFuseLiterals(); }
368 return !(isReadTPTPIDRURW() || isReadTPTPIDRURO() || isReadTPTPIDRPRW());
388 return isTargetMachO() ? (ReserveR9 || !HasV6Ops) : ReserveR9;
435 bool useAA()
const override {
return true; }
static bool isThumb(const MCSubtargetInfo &STI)
This file describes how to lower LLVM calls to machine code calls.
static cl::opt< OutputCostKind > CostKind("cost-kind", cl::desc("Target cost kind"), cl::init(OutputCostKind::RecipThroughput), cl::values(clEnumValN(OutputCostKind::RecipThroughput, "throughput", "Reciprocal throughput"), clEnumValN(OutputCostKind::Latency, "latency", "Instruction latency"), clEnumValN(OutputCostKind::CodeSize, "code-size", "Code size"), clEnumValN(OutputCostKind::SizeAndLatency, "size-latency", "Code size and latency"), clEnumValN(OutputCostKind::All, "all", "Print all cost kinds")))
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
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.
MCPhysReg getFramePointerReg() const
DenormalMode DM
DM - Denormal mode NEON and VFP RunFast mode are not IEEE 754 compliant, use this field to determine ...
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
ARMSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const ARMBaseTargetMachine &TM, bool IsLittle, bool MinSize=false, DenormalMode DM=DenormalMode::getIEEE())
This constructor initializes the data members to match that of the specified triple.
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 ignoreCSRForAllocationOrder(const MachineFunction &MF, MCRegister PhysReg) const override
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
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...
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.
Wrapper class representing physical registers. Should be passed by value.
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.
@ Swift
Calling convention for Swift.
This is an optimization pass for GlobalISel generic memory operations.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
This struct is a compact representation of a valid (non-zero power of two) alignment.
Represent subnormal handling kind for floating point instruction inputs and outputs.
static constexpr DenormalMode getIEEE()
Machine model for scheduling, bundling, and heuristics.