1 //===-- ARMSubtarget.h - Define Subtarget for the ARM ----------*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the ARM specific subclass of TargetSubtargetInfo.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H
15 #define LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H
17 #include "ARMBaseInstrInfo.h"
18 #include "ARMBaseRegisterInfo.h"
19 #include "ARMFrameLowering.h"
20 #include "ARMISelLowering.h"
21 #include "ARMSelectionDAGInfo.h"
22 #include "llvm/ADT/Triple.h"
23 #include "llvm/CodeGen/GlobalISel/GISelAccessor.h"
24 #include "llvm/CodeGen/MachineFunction.h"
25 #include "llvm/MC/MCInstrItineraries.h"
26 #include "llvm/MC/MCSchedule.h"
27 #include "llvm/Target/TargetOptions.h"
28 #include "llvm/Target/TargetSubtargetInfo.h"
32 #define GET_SUBTARGETINFO_HEADER
33 #include "ARMGenSubtargetInfo.inc"
37 class ARMBaseTargetMachine;
41 class ARMSubtarget : public ARMGenSubtargetInfo {
43 enum ARMProcFamilyEnum {
70 enum ARMProcClassEnum {
108 /// What kind of timing do load multiple/store multiple instructions have.
109 enum ARMLdStMultipleTiming {
110 /// Can load/store 2 registers/cycle.
112 /// Can load/store 2 registers/cycle, but needs an extra cycle if the access
113 /// is not 64-bit aligned.
114 DoubleIssueCheckUnalignedAccess,
115 /// Can load/store 1 register/cycle.
117 /// Can load/store 1 register/cycle, but needs an extra cycle for address
118 /// computation and potentially also for register writeback.
119 SingleIssuePlusExtras,
123 /// ARMProcFamily - ARM processor family: Cortex-A8, Cortex-A9, and others.
124 ARMProcFamilyEnum ARMProcFamily = Others;
126 /// ARMProcClass - ARM processor class: None, AClass, RClass or MClass.
127 ARMProcClassEnum ARMProcClass = None;
129 /// ARMArch - ARM architecture
130 ARMArchEnum ARMArch = ARMv4t;
132 /// HasV4TOps, HasV5TOps, HasV5TEOps,
133 /// HasV6Ops, HasV6MOps, HasV6KOps, HasV6T2Ops, HasV7Ops, HasV8Ops -
134 /// Specify whether target support specific ARM ISA variants.
135 bool HasV4TOps = false;
136 bool HasV5TOps = false;
137 bool HasV5TEOps = false;
138 bool HasV6Ops = false;
139 bool HasV6MOps = false;
140 bool HasV6KOps = false;
141 bool HasV6T2Ops = false;
142 bool HasV7Ops = false;
143 bool HasV8Ops = false;
144 bool HasV8_1aOps = false;
145 bool HasV8_2aOps = false;
146 bool HasV8MBaselineOps = false;
147 bool HasV8MMainlineOps = false;
149 /// HasVFPv2, HasVFPv3, HasVFPv4, HasFPARMv8, HasNEON - Specify what
150 /// floating point ISAs are supported.
151 bool HasVFPv2 = false;
152 bool HasVFPv3 = false;
153 bool HasVFPv4 = false;
154 bool HasFPARMv8 = false;
155 bool HasNEON = false;
157 /// UseNEONForSinglePrecisionFP - if the NEONFP attribute has been
158 /// specified. Use the method useNEONForSinglePrecisionFP() to
159 /// determine if NEON should actually be used.
160 bool UseNEONForSinglePrecisionFP = false;
162 /// UseMulOps - True if non-microcoded fused integer multiply-add and
163 /// multiply-subtract instructions should be used.
164 bool UseMulOps = false;
166 /// SlowFPVMLx - If the VFP2 / NEON instructions are available, indicates
167 /// whether the FP VML[AS] instructions are slow (if so, don't use them).
168 bool SlowFPVMLx = false;
170 /// HasVMLxForwarding - If true, NEON has special multiplier accumulator
171 /// forwarding to allow mul + mla being issued back to back.
172 bool HasVMLxForwarding = false;
174 /// SlowFPBrcc - True if floating point compare + branch is slow.
175 bool SlowFPBrcc = false;
177 /// InThumbMode - True if compiling for Thumb, false for ARM.
178 bool InThumbMode = false;
180 /// UseSoftFloat - True if we're using software floating point features.
181 bool UseSoftFloat = false;
183 /// HasThumb2 - True if Thumb2 instructions are supported.
184 bool HasThumb2 = false;
186 /// NoARM - True if subtarget does not support ARM mode execution.
189 /// ReserveR9 - True if R9 is not available as a general purpose register.
190 bool ReserveR9 = false;
192 /// NoMovt - True if MOVT / MOVW pairs are not used for materialization of
193 /// 32-bit imms (including global addresses).
196 /// SupportsTailCall - True if the OS supports tail call. The dynamic linker
197 /// must be able to synthesize call stubs for interworking between ARM and
199 bool SupportsTailCall = false;
201 /// HasFP16 - True if subtarget supports half-precision FP conversions
202 bool HasFP16 = false;
204 /// HasFullFP16 - True if subtarget supports half-precision FP operations
205 bool HasFullFP16 = false;
207 /// HasD16 - True if subtarget is limited to 16 double precision
208 /// FP registers for VFPv3.
211 /// HasHardwareDivide - True if subtarget supports [su]div
212 bool HasHardwareDivide = false;
214 /// HasHardwareDivideInARM - True if subtarget supports [su]div in ARM mode
215 bool HasHardwareDivideInARM = false;
217 /// HasDataBarrier - True if the subtarget supports DMB / DSB data barrier
219 bool HasDataBarrier = false;
221 /// HasV7Clrex - True if the subtarget supports CLREX instructions
222 bool HasV7Clrex = false;
224 /// HasAcquireRelease - True if the subtarget supports v8 atomics (LDA/LDAEX etc)
226 bool HasAcquireRelease = false;
228 /// Pref32BitThumb - If true, codegen would prefer 32-bit Thumb instructions
229 /// over 16-bit ones.
230 bool Pref32BitThumb = false;
232 /// AvoidCPSRPartialUpdate - If true, codegen would avoid using instructions
233 /// that partially update CPSR and add false dependency on the previous
234 /// CPSR setting instruction.
235 bool AvoidCPSRPartialUpdate = false;
237 /// AvoidMOVsShifterOperand - If true, codegen should avoid using flag setting
238 /// movs with shifter operand (i.e. asr, lsl, lsr).
239 bool AvoidMOVsShifterOperand = false;
241 /// HasRetAddrStack - Some processors perform return stack prediction. CodeGen should
242 /// avoid issue "normal" call instructions to callees which do not return.
243 bool HasRetAddrStack = false;
245 /// HasMPExtension - True if the subtarget supports Multiprocessing
246 /// extension (ARMv7 only).
247 bool HasMPExtension = false;
249 /// HasVirtualization - True if the subtarget supports the Virtualization
251 bool HasVirtualization = false;
253 /// FPOnlySP - If true, the floating point unit only supports single
255 bool FPOnlySP = false;
257 /// If true, the processor supports the Performance Monitor Extensions. These
258 /// include a generic cycle-counter as well as more fine-grained (often
259 /// implementation-specific) events.
260 bool HasPerfMon = false;
262 /// HasTrustZone - if true, processor supports TrustZone security extensions
263 bool HasTrustZone = false;
265 /// Has8MSecExt - if true, processor supports ARMv8-M Security Extensions
266 bool Has8MSecExt = false;
268 /// HasCrypto - if true, processor supports Cryptography extensions
269 bool HasCrypto = false;
271 /// HasCRC - if true, processor supports CRC instructions
274 /// HasRAS - if true, the processor supports RAS extensions
277 /// If true, the instructions "vmov.i32 d0, #0" and "vmov.i32 q0, #0" are
278 /// particularly effective at zeroing a VFP register.
279 bool HasZeroCycleZeroing = false;
281 /// HasFPAO - if true, processor does positive address offset computation faster
282 bool HasFPAO = false;
284 /// If true, if conversion may decide to leave some instructions unpredicated.
285 bool IsProfitableToUnpredicate = false;
287 /// If true, VMOV will be favored over VGETLNi32.
288 bool HasSlowVGETLNi32 = false;
290 /// If true, VMOV will be favored over VDUP.
291 bool HasSlowVDUP32 = false;
293 /// If true, VMOVSR will be favored over VMOVDRR.
294 bool PreferVMOVSR = false;
296 /// If true, ISHST barriers will be used for Release semantics.
297 bool PreferISHST = false;
299 /// If true, a VLDM/VSTM starting with an odd register number is considered to
300 /// take more microops than single VLDRS/VSTRS.
301 bool SlowOddRegister = false;
303 /// If true, loading into a D subregister will be penalized.
304 bool SlowLoadDSubregister = false;
306 /// If true, the AGU and NEON/FPU units are multiplexed.
307 bool HasMuxedUnits = false;
309 /// If true, VMOVS will never be widened to VMOVD
310 bool DontWidenVMOVS = false;
312 /// If true, run the MLx expansion pass.
313 bool ExpandMLx = false;
315 /// If true, VFP/NEON VMLA/VMLS have special RAW hazards.
316 bool HasVMLxHazards = false;
318 /// If true, VMOVRS, VMOVSR and VMOVS will be converted from VFP to NEON.
319 bool UseNEONForFPMovs = false;
321 /// If true, VLDn instructions take an extra cycle for unaligned accesses.
322 bool CheckVLDnAlign = false;
324 /// If true, VFP instructions are not pipelined.
325 bool NonpipelinedVFP = false;
327 /// StrictAlign - If true, the subtarget disallows unaligned memory
328 /// accesses for some types. For details, see
329 /// ARMTargetLowering::allowsMisalignedMemoryAccesses().
330 bool StrictAlign = false;
332 /// RestrictIT - If true, the subtarget disallows generation of deprecated IT
333 /// blocks to conform to ARMv8 rule.
334 bool RestrictIT = false;
336 /// HasDSP - If true, the subtarget supports the DSP (saturating arith
337 /// and such) instructions.
340 /// NaCl TRAP instruction is generated instead of the regular TRAP.
341 bool UseNaClTrap = false;
343 /// Generate calls via indirect call instructions.
344 bool GenLongCalls = false;
346 /// Generate code that does not contain data access to code sections.
347 bool GenExecuteOnly = false;
349 /// Target machine allowed unsafe FP math (such as use of NEON fp)
350 bool UnsafeFPMath = false;
352 /// UseSjLjEH - If true, the target uses SjLj exception handling (e.g. iOS).
353 bool UseSjLjEH = false;
355 /// Implicitly convert an instruction to a different one if its immediates
356 /// cannot be encoded. For example, ADD r0, r1, #FFFFFFFF -> SUB r0, r1, #1.
357 bool NegativeImmediates = true;
359 /// stackAlignment - The minimum alignment known to hold of the stack frame on
360 /// entry to the function and which must be maintained by every function.
361 unsigned stackAlignment = 4;
363 /// CPUString - String name of used CPU.
364 std::string CPUString;
366 unsigned MaxInterleaveFactor = 1;
368 /// Clearance before partial register updates (in number of instructions)
369 unsigned PartialUpdateClearance = 0;
371 /// What kind of timing do load multiple/store multiple have (double issue,
372 /// single issue etc).
373 ARMLdStMultipleTiming LdStMultipleTiming = SingleIssue;
375 /// The adjustment that we need to apply to get the operand latency from the
376 /// operand cycle returned by the itinerary data for pre-ISel operands.
377 int PreISelOperandLatencyAdjustment = 2;
379 /// IsLittle - The target is Little Endian
382 /// TargetTriple - What processor and OS we're targeting.
385 /// SchedModel - Processor specific instruction costs.
386 MCSchedModel SchedModel;
388 /// Selected instruction itineraries (one entry per itinerary class.)
389 InstrItineraryData InstrItins;
391 /// Options passed via command line that could influence the target
392 const TargetOptions &Options;
394 const ARMBaseTargetMachine &TM;
397 /// This constructor initializes the data members to match that
398 /// of the specified triple.
400 ARMSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
401 const ARMBaseTargetMachine &TM, bool IsLittle);
403 /// This object will take onwership of \p GISelAccessor.
404 void setGISelAccessor(GISelAccessor &GISel) { this->GISel.reset(&GISel); }
406 /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
407 /// that still makes it profitable to inline the call.
408 unsigned getMaxInlineSizeThreshold() const {
412 /// ParseSubtargetFeatures - Parses features string setting specified
413 /// subtarget options. Definition of function is auto generated by tblgen.
414 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
416 /// initializeSubtargetDependencies - Initializes using a CPU and feature string
417 /// so that we can use initializer lists for subtarget initialization.
418 ARMSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
420 const ARMSelectionDAGInfo *getSelectionDAGInfo() const override {
424 const ARMBaseInstrInfo *getInstrInfo() const override {
425 return InstrInfo.get();
428 const ARMTargetLowering *getTargetLowering() const override {
432 const ARMFrameLowering *getFrameLowering() const override {
433 return FrameLowering.get();
436 const ARMBaseRegisterInfo *getRegisterInfo() const override {
437 return &InstrInfo->getRegisterInfo();
440 const CallLowering *getCallLowering() const override;
441 const InstructionSelector *getInstructionSelector() const override;
442 const LegalizerInfo *getLegalizerInfo() const override;
443 const RegisterBankInfo *getRegBankInfo() const override;
446 ARMSelectionDAGInfo TSInfo;
447 // Either Thumb1FrameLowering or ARMFrameLowering.
448 std::unique_ptr<ARMFrameLowering> FrameLowering;
449 // Either Thumb1InstrInfo or Thumb2InstrInfo.
450 std::unique_ptr<ARMBaseInstrInfo> InstrInfo;
451 ARMTargetLowering TLInfo;
453 /// Gather the accessor points to GlobalISel-related APIs.
454 /// This is used to avoid ifndefs spreading around while GISel is
455 /// an optional library.
456 std::unique_ptr<GISelAccessor> GISel;
458 void initializeEnvironment();
459 void initSubtargetFeatures(StringRef CPU, StringRef FS);
460 ARMFrameLowering *initializeFrameLowering(StringRef CPU, StringRef FS);
463 void computeIssueWidth();
465 bool hasV4TOps() const { return HasV4TOps; }
466 bool hasV5TOps() const { return HasV5TOps; }
467 bool hasV5TEOps() const { return HasV5TEOps; }
468 bool hasV6Ops() const { return HasV6Ops; }
469 bool hasV6MOps() const { return HasV6MOps; }
470 bool hasV6KOps() const { return HasV6KOps; }
471 bool hasV6T2Ops() const { return HasV6T2Ops; }
472 bool hasV7Ops() const { return HasV7Ops; }
473 bool hasV8Ops() const { return HasV8Ops; }
474 bool hasV8_1aOps() const { return HasV8_1aOps; }
475 bool hasV8_2aOps() const { return HasV8_2aOps; }
476 bool hasV8MBaselineOps() const { return HasV8MBaselineOps; }
477 bool hasV8MMainlineOps() const { return HasV8MMainlineOps; }
480 /// These functions are obsolete, please consider adding subtarget features
481 /// or properties instead of calling them.
482 bool isCortexA5() const { return ARMProcFamily == CortexA5; }
483 bool isCortexA7() const { return ARMProcFamily == CortexA7; }
484 bool isCortexA8() const { return ARMProcFamily == CortexA8; }
485 bool isCortexA9() const { return ARMProcFamily == CortexA9; }
486 bool isCortexA15() const { return ARMProcFamily == CortexA15; }
487 bool isSwift() const { return ARMProcFamily == Swift; }
488 bool isCortexM3() const { return ARMProcFamily == CortexM3; }
489 bool isLikeA9() const { return isCortexA9() || isCortexA15() || isKrait(); }
490 bool isCortexR5() const { return ARMProcFamily == CortexR5; }
491 bool isKrait() const { return ARMProcFamily == Krait; }
494 bool hasARMOps() const { return !NoARM; }
496 bool hasVFP2() const { return HasVFPv2; }
497 bool hasVFP3() const { return HasVFPv3; }
498 bool hasVFP4() const { return HasVFPv4; }
499 bool hasFPARMv8() const { return HasFPARMv8; }
500 bool hasNEON() const { return HasNEON; }
501 bool hasCrypto() const { return HasCrypto; }
502 bool hasCRC() const { return HasCRC; }
503 bool hasRAS() const { return HasRAS; }
504 bool hasVirtualization() const { return HasVirtualization; }
506 bool useNEONForSinglePrecisionFP() const {
507 return hasNEON() && UseNEONForSinglePrecisionFP;
510 bool hasDivide() const { return HasHardwareDivide; }
511 bool hasDivideInARMMode() const { return HasHardwareDivideInARM; }
512 bool hasDataBarrier() const { return HasDataBarrier; }
513 bool hasV7Clrex() const { return HasV7Clrex; }
514 bool hasAcquireRelease() const { return HasAcquireRelease; }
516 bool hasAnyDataBarrier() const {
517 return HasDataBarrier || (hasV6Ops() && !isThumb());
520 bool useMulOps() const { return UseMulOps; }
521 bool useFPVMLx() const { return !SlowFPVMLx; }
522 bool hasVMLxForwarding() const { return HasVMLxForwarding; }
523 bool isFPBrccSlow() const { return SlowFPBrcc; }
524 bool isFPOnlySP() const { return FPOnlySP; }
525 bool hasPerfMon() const { return HasPerfMon; }
526 bool hasTrustZone() const { return HasTrustZone; }
527 bool has8MSecExt() const { return Has8MSecExt; }
528 bool hasZeroCycleZeroing() const { return HasZeroCycleZeroing; }
529 bool hasFPAO() const { return HasFPAO; }
530 bool isProfitableToUnpredicate() const { return IsProfitableToUnpredicate; }
531 bool hasSlowVGETLNi32() const { return HasSlowVGETLNi32; }
532 bool hasSlowVDUP32() const { return HasSlowVDUP32; }
533 bool preferVMOVSR() const { return PreferVMOVSR; }
534 bool preferISHSTBarriers() const { return PreferISHST; }
535 bool expandMLx() const { return ExpandMLx; }
536 bool hasVMLxHazards() const { return HasVMLxHazards; }
537 bool hasSlowOddRegister() const { return SlowOddRegister; }
538 bool hasSlowLoadDSubregister() const { return SlowLoadDSubregister; }
539 bool hasMuxedUnits() const { return HasMuxedUnits; }
540 bool dontWidenVMOVS() const { return DontWidenVMOVS; }
541 bool useNEONForFPMovs() const { return UseNEONForFPMovs; }
542 bool checkVLDnAccessAlignment() const { return CheckVLDnAlign; }
543 bool nonpipelinedVFP() const { return NonpipelinedVFP; }
544 bool prefers32BitThumb() const { return Pref32BitThumb; }
545 bool avoidCPSRPartialUpdate() const { return AvoidCPSRPartialUpdate; }
546 bool avoidMOVsShifterOperand() const { return AvoidMOVsShifterOperand; }
547 bool hasRetAddrStack() const { return HasRetAddrStack; }
548 bool hasMPExtension() const { return HasMPExtension; }
549 bool hasDSP() const { return HasDSP; }
550 bool useNaClTrap() const { return UseNaClTrap; }
551 bool useSjLjEH() const { return UseSjLjEH; }
552 bool genLongCalls() const { return GenLongCalls; }
553 bool genExecuteOnly() const { return GenExecuteOnly; }
555 bool hasFP16() const { return HasFP16; }
556 bool hasD16() const { return HasD16; }
557 bool hasFullFP16() const { return HasFullFP16; }
559 const Triple &getTargetTriple() const { return TargetTriple; }
561 bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
562 bool isTargetIOS() const { return TargetTriple.isiOS(); }
563 bool isTargetWatchOS() const { return TargetTriple.isWatchOS(); }
564 bool isTargetWatchABI() const { return TargetTriple.isWatchABI(); }
565 bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
566 bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
567 bool isTargetNetBSD() const { return TargetTriple.isOSNetBSD(); }
568 bool isTargetWindows() const { return TargetTriple.isOSWindows(); }
570 bool isTargetCOFF() const { return TargetTriple.isOSBinFormatCOFF(); }
571 bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
572 bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }
574 // ARM EABI is the bare-metal EABI described in ARM ABI documents and
575 // can be accessed via -target arm-none-eabi. This is NOT GNUEABI.
576 // FIXME: Add a flag for bare-metal for that target and set Triple::EABI
577 // even for GNUEABI, so we can make a distinction here and still conform to
578 // the EABI on GNU (and Android) mode. This requires change in Clang, too.
579 // FIXME: The Darwin exception is temporary, while we move users to
580 // "*-*-*-macho" triples as quickly as possible.
581 bool isTargetAEABI() const {
582 return (TargetTriple.getEnvironment() == Triple::EABI ||
583 TargetTriple.getEnvironment() == Triple::EABIHF) &&
584 !isTargetDarwin() && !isTargetWindows();
586 bool isTargetGNUAEABI() const {
587 return (TargetTriple.getEnvironment() == Triple::GNUEABI ||
588 TargetTriple.getEnvironment() == Triple::GNUEABIHF) &&
589 !isTargetDarwin() && !isTargetWindows();
591 bool isTargetMuslAEABI() const {
592 return (TargetTriple.getEnvironment() == Triple::MuslEABI ||
593 TargetTriple.getEnvironment() == Triple::MuslEABIHF) &&
594 !isTargetDarwin() && !isTargetWindows();
597 // ARM Targets that support EHABI exception handling standard
598 // Darwin uses SjLj. Other targets might need more checks.
599 bool isTargetEHABICompatible() const {
600 return (TargetTriple.getEnvironment() == Triple::EABI ||
601 TargetTriple.getEnvironment() == Triple::GNUEABI ||
602 TargetTriple.getEnvironment() == Triple::MuslEABI ||
603 TargetTriple.getEnvironment() == Triple::EABIHF ||
604 TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
605 TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
606 isTargetAndroid()) &&
607 !isTargetDarwin() && !isTargetWindows();
610 bool isTargetHardFloat() const {
611 // FIXME: this is invalid for WindowsCE
612 return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
613 TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
614 TargetTriple.getEnvironment() == Triple::EABIHF ||
615 isTargetWindows() || isAAPCS16_ABI();
618 bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
620 bool isXRaySupported() const override;
622 bool isAPCS_ABI() const;
623 bool isAAPCS_ABI() const;
624 bool isAAPCS16_ABI() const;
629 bool useSoftFloat() const { return UseSoftFloat; }
630 bool isThumb() const { return InThumbMode; }
631 bool isThumb1Only() const { return InThumbMode && !HasThumb2; }
632 bool isThumb2() const { return InThumbMode && HasThumb2; }
633 bool hasThumb2() const { return HasThumb2; }
634 bool isMClass() const { return ARMProcClass == MClass; }
635 bool isRClass() const { return ARMProcClass == RClass; }
636 bool isAClass() const { return ARMProcClass == AClass; }
638 bool isR9Reserved() const {
639 return isTargetMachO() ? (ReserveR9 || !HasV6Ops) : ReserveR9;
642 bool useR7AsFramePointer() const {
643 return isTargetDarwin() || (!isTargetWindows() && isThumb());
646 /// Returns true if the frame setup is split into two separate pushes (first
647 /// r0-r7,lr then r8-r11), principally so that the frame pointer is adjacent
648 /// to lr. This is always required on Thumb1-only targets, as the push and
649 /// pop instructions can't access the high registers.
650 bool splitFramePushPop(const MachineFunction &MF) const {
651 return (useR7AsFramePointer() &&
652 MF.getTarget().Options.DisableFramePointerElim(MF)) ||
656 bool useStride4VFPs(const MachineFunction &MF) const;
658 bool useMovt(const MachineFunction &MF) const;
660 bool supportsTailCall() const { return SupportsTailCall; }
662 bool allowsUnalignedMem() const { return !StrictAlign; }
664 bool restrictIT() const { return RestrictIT; }
666 const std::string & getCPUString() const { return CPUString; }
668 bool isLittle() const { return IsLittle; }
670 unsigned getMispredictionPenalty() const;
672 /// This function returns true if the target has sincos() routine in its
673 /// compiler runtime or math libraries.
674 bool hasSinCos() const;
676 /// Returns true if machine scheduler should be enabled.
677 bool enableMachineScheduler() const override;
679 /// True for some subtargets at > -O0.
680 bool enablePostRAScheduler() const override;
682 // enableAtomicExpand- True if we need to expand our atomics.
683 bool enableAtomicExpand() const override;
685 /// getInstrItins - Return the instruction itineraries based on subtarget
687 const InstrItineraryData *getInstrItineraryData() const override {
691 /// getStackAlignment - Returns the minimum alignment known to hold of the
692 /// stack frame on entry to the function and which must be maintained by every
693 /// function for this subtarget.
694 unsigned getStackAlignment() const { return stackAlignment; }
696 unsigned getMaxInterleaveFactor() const { return MaxInterleaveFactor; }
698 unsigned getPartialUpdateClearance() const { return PartialUpdateClearance; }
700 ARMLdStMultipleTiming getLdStMultipleTiming() const {
701 return LdStMultipleTiming;
704 int getPreISelOperandLatencyAdjustment() const {
705 return PreISelOperandLatencyAdjustment;
708 /// True if the GV will be accessed via an indirect symbol.
709 bool isGVIndirectSymbol(const GlobalValue *GV) const;
711 /// True if fast-isel is used.
712 bool useFastISel() const;
715 } // end namespace llvm
717 #endif // LLVM_LIB_TARGET_ARM_ARMSUBTARGET_H