2012-02-18 12:03:15 +00:00
|
|
|
//===-- ARMSubtarget.cpp - ARM Subtarget Information ----------------------===//
|
2007-01-19 07:51:42 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-01-19 07:51:42 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2011-07-01 21:01:15 +00:00
|
|
|
// This file implements the ARM specific subclass of TargetSubtargetInfo.
|
2007-01-19 07:51:42 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "ARMSubtarget.h"
|
2014-06-26 19:30:02 +00:00
|
|
|
#include "ARMFrameLowering.h"
|
|
|
|
#include "ARMISelLowering.h"
|
|
|
|
#include "ARMInstrInfo.h"
|
2015-01-14 11:23:27 +00:00
|
|
|
#include "ARMMachineFunctionInfo.h"
|
2014-06-26 19:30:02 +00:00
|
|
|
#include "ARMSelectionDAGInfo.h"
|
|
|
|
#include "ARMSubtarget.h"
|
2014-12-18 02:20:58 +00:00
|
|
|
#include "ARMTargetMachine.h"
|
2014-06-26 19:30:02 +00:00
|
|
|
#include "Thumb1FrameLowering.h"
|
|
|
|
#include "Thumb1InstrInfo.h"
|
|
|
|
#include "Thumb2InstrInfo.h"
|
2015-01-14 11:23:27 +00:00
|
|
|
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
2013-02-15 22:41:25 +00:00
|
|
|
#include "llvm/IR/Attributes.h"
|
|
|
|
#include "llvm/IR/Function.h"
|
2014-01-07 11:48:04 +00:00
|
|
|
#include "llvm/IR/GlobalValue.h"
|
2009-06-22 21:01:46 +00:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
2012-12-03 16:50:05 +00:00
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
2013-03-21 18:47:47 +00:00
|
|
|
#include "llvm/Target/TargetOptions.h"
|
2014-07-15 17:18:41 +00:00
|
|
|
#include "llvm/Target/TargetRegisterInfo.h"
|
2011-07-01 20:45:01 +00:00
|
|
|
|
2014-04-22 02:03:14 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
2014-04-21 22:55:11 +00:00
|
|
|
#define DEBUG_TYPE "arm-subtarget"
|
|
|
|
|
2011-07-01 20:45:01 +00:00
|
|
|
#define GET_SUBTARGETINFO_TARGET_DESC
|
2011-07-08 01:53:10 +00:00
|
|
|
#define GET_SUBTARGETINFO_CTOR
|
2011-07-01 22:36:09 +00:00
|
|
|
#include "ARMGenSubtargetInfo.inc"
|
2011-07-01 20:45:01 +00:00
|
|
|
|
2009-06-22 21:01:46 +00:00
|
|
|
static cl::opt<bool>
|
|
|
|
ReserveR9("arm-reserve-r9", cl::Hidden,
|
|
|
|
cl::desc("Reserve R9, making it unavailable as GPR"));
|
|
|
|
|
2009-11-24 00:44:37 +00:00
|
|
|
static cl::opt<bool>
|
2013-08-15 20:54:38 +00:00
|
|
|
ArmUseMOVT("arm-use-movt", cl::init(true), cl::Hidden);
|
2009-11-24 00:44:37 +00:00
|
|
|
|
2012-09-29 21:43:49 +00:00
|
|
|
static cl::opt<bool>
|
|
|
|
UseFusedMulOps("arm-use-mulops",
|
|
|
|
cl::init(true), cl::Hidden);
|
|
|
|
|
2014-08-19 18:40:39 +00:00
|
|
|
namespace {
|
2013-05-17 23:49:01 +00:00
|
|
|
enum AlignMode {
|
|
|
|
DefaultAlign,
|
|
|
|
StrictAlign,
|
|
|
|
NoStrictAlign
|
|
|
|
};
|
2014-08-19 18:40:39 +00:00
|
|
|
}
|
2013-05-17 23:49:01 +00:00
|
|
|
|
|
|
|
static cl::opt<AlignMode>
|
|
|
|
Align(cl::desc("Load/store alignment support"),
|
|
|
|
cl::Hidden, cl::init(DefaultAlign),
|
|
|
|
cl::values(
|
|
|
|
clEnumValN(DefaultAlign, "arm-default-align",
|
|
|
|
"Generate unaligned accesses only on hardware/OS "
|
|
|
|
"combinations that are known to support them"),
|
|
|
|
clEnumValN(StrictAlign, "arm-strict-align",
|
|
|
|
"Disallow all unaligned memory accesses"),
|
|
|
|
clEnumValN(NoStrictAlign, "arm-no-strict-align",
|
|
|
|
"Allow unaligned memory accesses"),
|
|
|
|
clEnumValEnd));
|
2010-09-28 04:09:35 +00:00
|
|
|
|
2013-11-13 18:29:49 +00:00
|
|
|
enum ITMode {
|
|
|
|
DefaultIT,
|
|
|
|
RestrictedIT,
|
|
|
|
NoRestrictedIT
|
|
|
|
};
|
|
|
|
|
|
|
|
static cl::opt<ITMode>
|
|
|
|
IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT),
|
|
|
|
cl::ZeroOrMore,
|
|
|
|
cl::values(clEnumValN(DefaultIT, "arm-default-it",
|
|
|
|
"Generate IT block based on arch"),
|
|
|
|
clEnumValN(RestrictedIT, "arm-restrict-it",
|
|
|
|
"Disallow deprecated IT based on ARMv8"),
|
|
|
|
clEnumValN(NoRestrictedIT, "arm-no-restrict-it",
|
|
|
|
"Allow IT blocks based on ARMv7"),
|
|
|
|
clEnumValEnd));
|
|
|
|
|
2014-06-13 00:20:35 +00:00
|
|
|
/// initializeSubtargetDependencies - Initializes using a CPU and feature string
|
|
|
|
/// so that we can use initializer lists for subtarget initialization.
|
|
|
|
ARMSubtarget &ARMSubtarget::initializeSubtargetDependencies(StringRef CPU,
|
|
|
|
StringRef FS) {
|
2013-02-16 01:36:26 +00:00
|
|
|
initializeEnvironment();
|
2014-09-03 20:36:31 +00:00
|
|
|
initSubtargetFeatures(CPU, FS);
|
2014-06-13 00:20:35 +00:00
|
|
|
return *this;
|
2013-02-15 22:41:25 +00:00
|
|
|
}
|
|
|
|
|
2015-01-26 19:03:15 +00:00
|
|
|
ARMFrameLowering *ARMSubtarget::initializeFrameLowering(StringRef CPU,
|
|
|
|
StringRef FS) {
|
|
|
|
ARMSubtarget &STI = initializeSubtargetDependencies(CPU, FS);
|
|
|
|
if (STI.isThumb1Only())
|
|
|
|
return (ARMFrameLowering *)new Thumb1FrameLowering(STI);
|
|
|
|
|
|
|
|
return new ARMFrameLowering(STI);
|
|
|
|
}
|
|
|
|
|
2015-06-10 12:11:26 +00:00
|
|
|
ARMSubtarget::ARMSubtarget(const Triple &TT, const std::string &CPU,
|
2015-01-26 19:03:15 +00:00
|
|
|
const std::string &FS,
|
|
|
|
const ARMBaseTargetMachine &TM, bool IsLittle)
|
2014-06-13 00:20:35 +00:00
|
|
|
: ARMGenSubtargetInfo(TT, CPU, FS), ARMProcFamily(Others),
|
|
|
|
ARMProcClass(None), stackAlignment(4), CPUString(CPU), IsLittle(IsLittle),
|
2014-12-18 02:20:58 +00:00
|
|
|
TargetTriple(TT), Options(TM.Options), TM(TM),
|
2015-01-26 19:03:15 +00:00
|
|
|
TSInfo(*TM.getDataLayout()),
|
|
|
|
FrameLowering(initializeFrameLowering(CPU, FS)),
|
|
|
|
// At this point initializeSubtargetDependencies has been called so
|
|
|
|
// we can query directly.
|
2014-06-26 19:30:02 +00:00
|
|
|
InstrInfo(isThumb1Only()
|
|
|
|
? (ARMBaseInstrInfo *)new Thumb1InstrInfo(*this)
|
|
|
|
: !isThumb()
|
|
|
|
? (ARMBaseInstrInfo *)new ARMInstrInfo(*this)
|
|
|
|
: (ARMBaseInstrInfo *)new Thumb2InstrInfo(*this)),
|
2015-01-29 00:19:39 +00:00
|
|
|
TLInfo(TM, *this) {}
|
2014-06-13 00:20:35 +00:00
|
|
|
|
2013-02-16 01:36:26 +00:00
|
|
|
void ARMSubtarget::initializeEnvironment() {
|
|
|
|
HasV4TOps = false;
|
|
|
|
HasV5TOps = false;
|
|
|
|
HasV5TEOps = false;
|
|
|
|
HasV6Ops = false;
|
2013-10-07 16:55:23 +00:00
|
|
|
HasV6MOps = false;
|
2015-03-17 11:55:28 +00:00
|
|
|
HasV6KOps = false;
|
2013-02-16 01:36:26 +00:00
|
|
|
HasV6T2Ops = false;
|
|
|
|
HasV7Ops = false;
|
2013-06-26 16:58:26 +00:00
|
|
|
HasV8Ops = false;
|
2015-04-01 14:54:56 +00:00
|
|
|
HasV8_1aOps = false;
|
2013-02-16 01:36:26 +00:00
|
|
|
HasVFPv2 = false;
|
|
|
|
HasVFPv3 = false;
|
|
|
|
HasVFPv4 = false;
|
2013-09-13 13:46:57 +00:00
|
|
|
HasFPARMv8 = false;
|
2013-02-16 01:36:26 +00:00
|
|
|
HasNEON = false;
|
|
|
|
UseNEONForSinglePrecisionFP = false;
|
|
|
|
UseMulOps = UseFusedMulOps;
|
|
|
|
SlowFPVMLx = false;
|
|
|
|
HasVMLxForwarding = false;
|
|
|
|
SlowFPBrcc = false;
|
|
|
|
InThumbMode = false;
|
2015-05-12 01:26:05 +00:00
|
|
|
UseSoftFloat = false;
|
2013-02-16 01:36:26 +00:00
|
|
|
HasThumb2 = false;
|
|
|
|
NoARM = false;
|
|
|
|
IsR9Reserved = ReserveR9;
|
|
|
|
UseMovt = false;
|
|
|
|
SupportsTailCall = false;
|
|
|
|
HasFP16 = false;
|
|
|
|
HasD16 = false;
|
|
|
|
HasHardwareDivide = false;
|
|
|
|
HasHardwareDivideInARM = false;
|
|
|
|
HasT2ExtractPack = false;
|
|
|
|
HasDataBarrier = false;
|
|
|
|
Pref32BitThumb = false;
|
|
|
|
AvoidCPSRPartialUpdate = false;
|
|
|
|
AvoidMOVsShifterOperand = false;
|
|
|
|
HasRAS = false;
|
|
|
|
HasMPExtension = false;
|
2013-11-01 13:27:35 +00:00
|
|
|
HasVirtualization = false;
|
2013-02-16 01:36:26 +00:00
|
|
|
FPOnlySP = false;
|
2013-05-23 19:11:14 +00:00
|
|
|
HasPerfMon = false;
|
2013-04-10 12:08:35 +00:00
|
|
|
HasTrustZone = false;
|
2013-09-19 11:59:01 +00:00
|
|
|
HasCrypto = false;
|
2013-10-29 16:54:52 +00:00
|
|
|
HasCRC = false;
|
2014-04-01 13:22:02 +00:00
|
|
|
HasZeroCycleZeroing = false;
|
2013-02-16 01:36:26 +00:00
|
|
|
AllowsUnalignedMem = false;
|
|
|
|
Thumb2DSP = false;
|
|
|
|
UseNaClTrap = false;
|
2013-03-21 18:47:47 +00:00
|
|
|
UnsafeFPMath = false;
|
2013-02-16 01:36:26 +00:00
|
|
|
}
|
|
|
|
|
2014-09-03 20:36:31 +00:00
|
|
|
void ARMSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
|
2013-09-02 17:09:01 +00:00
|
|
|
if (CPUString.empty()) {
|
2014-12-11 18:49:37 +00:00
|
|
|
if (isTargetDarwin() && TargetTriple.getArchName().endswith("v7s"))
|
2013-09-02 17:09:01 +00:00
|
|
|
// Default to the Swift CPU when targeting armv7s/thumbv7s.
|
|
|
|
CPUString = "swift";
|
|
|
|
else
|
|
|
|
CPUString = "generic";
|
|
|
|
}
|
2009-03-08 04:02:49 +00:00
|
|
|
|
2011-06-30 02:12:44 +00:00
|
|
|
// Insert the architecture feature derived from the target triple into the
|
|
|
|
// feature string. This is important for setting features that are implied
|
|
|
|
// based on the architecture version.
|
2015-06-10 12:11:26 +00:00
|
|
|
std::string ArchFS = ARM_MC::ParseARMTriple(TargetTriple, CPUString);
|
2011-07-07 00:08:19 +00:00
|
|
|
if (!FS.empty()) {
|
|
|
|
if (!ArchFS.empty())
|
2015-03-30 15:42:36 +00:00
|
|
|
ArchFS = (Twine(ArchFS) + "," + FS).str();
|
2011-07-07 00:08:19 +00:00
|
|
|
else
|
|
|
|
ArchFS = FS;
|
|
|
|
}
|
2011-07-07 07:07:08 +00:00
|
|
|
ParseSubtargetFeatures(CPUString, ArchFS);
|
2011-07-07 00:08:19 +00:00
|
|
|
|
2013-12-13 11:16:00 +00:00
|
|
|
// FIXME: This used enable V6T2 support implicitly for Thumb2 mode.
|
|
|
|
// Assert this for now to make the change obvious.
|
|
|
|
assert(hasV6T2Ops() || !hasThumb2());
|
2010-11-09 22:50:47 +00:00
|
|
|
|
2012-08-08 02:44:16 +00:00
|
|
|
// Keep a pointer to static instruction cost data for the specified CPU.
|
|
|
|
SchedModel = getSchedModelForCPU(CPUString);
|
|
|
|
|
2011-07-01 20:45:01 +00:00
|
|
|
// Initialize scheduling itinerary for the specified CPU.
|
|
|
|
InstrItins = getInstrItineraryForCPU(CPUString);
|
|
|
|
|
2014-04-02 20:32:05 +00:00
|
|
|
// FIXME: this is invalid for WindowsCE
|
2014-12-18 02:08:45 +00:00
|
|
|
if (isTargetWindows())
|
2014-04-02 20:32:05 +00:00
|
|
|
NoARM = true;
|
|
|
|
|
2007-02-13 19:52:28 +00:00
|
|
|
if (isAAPCS_ABI())
|
|
|
|
stackAlignment = 8;
|
Use 16 byte stack alignment for NaCl on ARM
NaCl's ARM ABI uses 16 byte stack alignment, so set that in
ARMSubtarget.cpp.
Using 16 byte alignment exposes an issue in code generation in which a
varargs function leaves a 4 byte gap between the values of r1-r3 saved
to the stack and the following arguments that were passed on the
stack. (Previously, this code only needed to support 4 byte and 8
byte alignment.)
With this issue, llc generated:
varargs_func:
sub sp, sp, #16
push {lr}
sub sp, sp, #12
add r0, sp, #16 // Should be 20
stm r0, {r1, r2, r3}
ldr r0, .LCPI0_0 // Address of va_list
add r1, sp, #16
str r1, [r0]
bl external_func
Fix the bug by checking for "Align > 4". Also simplify the code by
using OffsetToAlignment(), and update comments.
Differential Revision: http://llvm-reviews.chandlerc.com/D2677
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201497 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-16 18:59:48 +00:00
|
|
|
if (isTargetNaCl())
|
|
|
|
stackAlignment = 16;
|
2007-02-13 19:52:28 +00:00
|
|
|
|
2013-08-15 20:54:38 +00:00
|
|
|
UseMovt = hasV6T2Ops() && ArmUseMOVT;
|
|
|
|
|
2014-01-06 14:28:05 +00:00
|
|
|
if (isTargetMachO()) {
|
2014-09-17 01:47:52 +00:00
|
|
|
IsR9Reserved = ReserveR9 || !HasV6Ops;
|
2014-01-06 14:28:05 +00:00
|
|
|
SupportsTailCall = !isTargetIOS() || !getTargetTriple().isOSVersionLT(5, 0);
|
2014-03-11 15:09:44 +00:00
|
|
|
} else {
|
2014-01-06 14:28:05 +00:00
|
|
|
IsR9Reserved = ReserveR9;
|
2014-03-11 15:09:44 +00:00
|
|
|
SupportsTailCall = !isThumb1Only();
|
|
|
|
}
|
2009-10-01 21:46:35 +00:00
|
|
|
|
2014-10-08 12:26:13 +00:00
|
|
|
if (Align == DefaultAlign) {
|
|
|
|
// Assume pre-ARMv6 doesn't support unaligned accesses.
|
|
|
|
//
|
|
|
|
// ARMv6 may or may not support unaligned accesses depending on the
|
|
|
|
// SCTLR.U bit, which is architecture-specific. We assume ARMv6
|
|
|
|
// Darwin and NetBSD targets support unaligned accesses, and others don't.
|
|
|
|
//
|
|
|
|
// ARMv7 always has SCTLR.U set to 1, but it has a new SCTLR.A bit
|
|
|
|
// which raises an alignment fault on unaligned accesses. Linux
|
|
|
|
// defaults this bit to 0 and handles it as a system-wide (not
|
|
|
|
// per-process) setting. It is therefore safe to assume that ARMv7+
|
|
|
|
// Linux targets support unaligned accesses. The same goes for NaCl.
|
|
|
|
//
|
|
|
|
// The above behavior is consistent with GCC.
|
|
|
|
AllowsUnalignedMem =
|
|
|
|
(hasV7Ops() && (isTargetLinux() || isTargetNaCl() ||
|
|
|
|
isTargetNetBSD())) ||
|
|
|
|
(hasV6Ops() && (isTargetMachO() || isTargetNetBSD()));
|
|
|
|
} else {
|
|
|
|
AllowsUnalignedMem = !(Align == StrictAlign);
|
2013-05-17 23:49:01 +00:00
|
|
|
}
|
2013-03-21 18:47:47 +00:00
|
|
|
|
2014-10-08 12:26:16 +00:00
|
|
|
// No v6M core supports unaligned memory access (v6M ARM ARM A3.2)
|
|
|
|
if (isV6M())
|
|
|
|
AllowsUnalignedMem = false;
|
|
|
|
|
2013-11-13 18:29:49 +00:00
|
|
|
switch (IT) {
|
|
|
|
case DefaultIT:
|
2015-04-14 15:32:58 +00:00
|
|
|
RestrictIT = hasV8Ops();
|
2013-11-13 18:29:49 +00:00
|
|
|
break;
|
|
|
|
case RestrictedIT:
|
|
|
|
RestrictIT = true;
|
|
|
|
break;
|
|
|
|
case NoRestrictedIT:
|
|
|
|
RestrictIT = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-03-21 18:47:47 +00:00
|
|
|
// NEON f32 ops are non-IEEE 754 compliant. Darwin is ok with it by default.
|
2015-05-26 10:47:10 +00:00
|
|
|
const FeatureBitset &Bits = getFeatureBits();
|
|
|
|
if ((Bits[ARM::ProcA5] || Bits[ARM::ProcA8]) && // Where this matters
|
2013-03-21 18:47:47 +00:00
|
|
|
(Options.UnsafeFPMath || isTargetDarwin()))
|
|
|
|
UseNEONForSinglePrecisionFP = true;
|
2007-01-19 07:51:42 +00:00
|
|
|
}
|
2009-08-28 23:18:09 +00:00
|
|
|
|
2014-12-18 02:20:58 +00:00
|
|
|
bool ARMSubtarget::isAPCS_ABI() const {
|
|
|
|
assert(TM.TargetABI != ARMBaseTargetMachine::ARM_ABI_UNKNOWN);
|
|
|
|
return TM.TargetABI == ARMBaseTargetMachine::ARM_ABI_APCS;
|
|
|
|
}
|
|
|
|
bool ARMSubtarget::isAAPCS_ABI() const {
|
|
|
|
assert(TM.TargetABI != ARMBaseTargetMachine::ARM_ABI_UNKNOWN);
|
|
|
|
return TM.TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS;
|
|
|
|
}
|
|
|
|
|
2009-08-28 23:18:09 +00:00
|
|
|
/// GVIsIndirectSymbol - true if the GV will be accessed via an indirect symbol.
|
2009-09-03 07:04:02 +00:00
|
|
|
bool
|
2010-04-15 01:51:59 +00:00
|
|
|
ARMSubtarget::GVIsIndirectSymbol(const GlobalValue *GV,
|
|
|
|
Reloc::Model RelocM) const {
|
2009-09-03 07:04:02 +00:00
|
|
|
if (RelocM == Reloc::Static)
|
2009-08-28 23:18:09 +00:00
|
|
|
return false;
|
2009-09-03 07:04:02 +00:00
|
|
|
|
2014-11-01 16:46:18 +00:00
|
|
|
bool isDecl = GV->isDeclarationForLinker();
|
2009-09-03 07:04:02 +00:00
|
|
|
|
2014-01-06 14:28:05 +00:00
|
|
|
if (!isTargetMachO()) {
|
2009-09-03 07:04:02 +00:00
|
|
|
// Extra load is needed for all externally visible.
|
|
|
|
if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())
|
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
if (RelocM == Reloc::PIC_) {
|
|
|
|
// If this is a strong reference to a definition, it is definitely not
|
|
|
|
// through a stub.
|
|
|
|
if (!isDecl && !GV->isWeakForLinker())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Unless we have a symbol with hidden visibility, we have to go through a
|
|
|
|
// normal $non_lazy_ptr stub because this symbol might be resolved late.
|
|
|
|
if (!GV->hasHiddenVisibility()) // Non-hidden $non_lazy_ptr reference.
|
|
|
|
return true;
|
|
|
|
|
|
|
|
// If symbol visibility is hidden, we have a stub for common symbol
|
|
|
|
// references and external declarations.
|
|
|
|
if (isDecl || GV->hasCommonLinkage())
|
|
|
|
// Hidden $non_lazy_ptr reference.
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
// If this is a strong reference to a definition, it is definitely not
|
|
|
|
// through a stub.
|
|
|
|
if (!isDecl && !GV->isWeakForLinker())
|
|
|
|
return false;
|
2010-12-24 04:28:06 +00:00
|
|
|
|
2009-09-03 07:04:02 +00:00
|
|
|
// Unless we have a symbol with hidden visibility, we have to go through a
|
|
|
|
// normal $non_lazy_ptr stub because this symbol might be resolved late.
|
|
|
|
if (!GV->hasHiddenVisibility()) // Non-hidden $non_lazy_ptr reference.
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2009-08-28 23:18:09 +00:00
|
|
|
}
|
2009-11-10 00:48:55 +00:00
|
|
|
|
2010-09-28 21:57:50 +00:00
|
|
|
unsigned ARMSubtarget::getMispredictionPenalty() const {
|
2014-09-02 17:43:54 +00:00
|
|
|
return SchedModel.MispredictPenalty;
|
2010-09-28 21:57:50 +00:00
|
|
|
}
|
|
|
|
|
2013-11-03 06:14:38 +00:00
|
|
|
bool ARMSubtarget::hasSinCos() const {
|
2014-10-09 05:43:30 +00:00
|
|
|
return getTargetTriple().isiOS() && !getTargetTriple().isOSVersionLT(7, 0);
|
2013-11-03 06:14:38 +00:00
|
|
|
}
|
|
|
|
|
2014-07-15 22:39:58 +00:00
|
|
|
// This overrides the PostRAScheduler bit in the SchedModel for any CPU.
|
2015-06-13 03:42:16 +00:00
|
|
|
bool ARMSubtarget::enablePostRAScheduler() const {
|
2014-07-15 22:39:58 +00:00
|
|
|
return (!isThumb() || hasThumb2());
|
2014-06-04 07:06:27 +00:00
|
|
|
}
|
|
|
|
|
2014-08-21 21:50:01 +00:00
|
|
|
bool ARMSubtarget::enableAtomicExpand() const {
|
2014-06-19 21:03:04 +00:00
|
|
|
return hasAnyDataBarrier() && !isThumb1Only();
|
|
|
|
}
|
|
|
|
|
2014-07-04 01:55:26 +00:00
|
|
|
bool ARMSubtarget::useMovt(const MachineFunction &MF) const {
|
|
|
|
// NOTE Windows on ARM needs to use mov.w/mov.t pairs to materialise 32-bit
|
|
|
|
// immediates as it is inherently position independent, and may be out of
|
|
|
|
// range otherwise.
|
|
|
|
return UseMovt && (isTargetWindows() ||
|
2015-02-14 02:24:44 +00:00
|
|
|
!MF.getFunction()->hasFnAttribute(Attribute::MinSize));
|
2014-07-04 01:55:26 +00:00
|
|
|
}
|
2015-05-23 01:14:08 +00:00
|
|
|
|
|
|
|
bool ARMSubtarget::useFastISel() const {
|
|
|
|
// Thumb2 support on iOS; ARM support on iOS, Linux and NaCl.
|
|
|
|
return TM.Options.EnableFastISel &&
|
|
|
|
((isTargetMachO() && !isThumb1Only()) ||
|
|
|
|
(isTargetLinux() && !isThumb()) || (isTargetNaCl() && !isThumb()));
|
|
|
|
}
|