mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
ARM MachO: sort out isTargetDarwin/isTargetIOS/... checks.
The ARM backend has been using most of the MachO related subtarget checks almost interchangeably, and since the only target it's had to run on has been IOS (which is all three of MachO, Darwin and IOS) it's worked out OK so far. But we'd like to support embedded targets under the "*-*-none-macho" triple, which means everything starts falling apart and inconsistent behaviours emerge. This patch should pick a reasonably sensible set of behaviours for the new triple (and any others that come along, with luck). Some choices were debatable (notably FP == r7 or r11), but we can revisit those later when deficiencies become apparent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198617 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -675,18 +675,18 @@ unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, MVT VT) {
|
||||
(const TargetRegisterClass*)&ARM::GPRRegClass;
|
||||
unsigned DestReg = createResultReg(RC);
|
||||
|
||||
// FastISel TLS support on non-Darwin is broken, punt to SelectionDAG.
|
||||
// FastISel TLS support on non-MachO is broken, punt to SelectionDAG.
|
||||
const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
|
||||
bool IsThreadLocal = GVar && GVar->isThreadLocal();
|
||||
if (!Subtarget->isTargetDarwin() && IsThreadLocal) return 0;
|
||||
if (!Subtarget->isTargetMachO() && IsThreadLocal) return 0;
|
||||
|
||||
// Use movw+movt when possible, it avoids constant pool entries.
|
||||
// Non-darwin targets only support static movt relocations in FastISel.
|
||||
if (Subtarget->useMovt() &&
|
||||
(Subtarget->isTargetDarwin() || RelocM == Reloc::Static)) {
|
||||
(Subtarget->isTargetMachO() || RelocM == Reloc::Static)) {
|
||||
unsigned Opc;
|
||||
unsigned char TF = 0;
|
||||
if (Subtarget->isTargetDarwin())
|
||||
if (Subtarget->isTargetMachO())
|
||||
TF = ARMII::MO_NONLAZY;
|
||||
|
||||
switch (RelocM) {
|
||||
@@ -3144,7 +3144,7 @@ namespace llvm {
|
||||
const ARMSubtarget *Subtarget = &TM.getSubtarget<ARMSubtarget>();
|
||||
// Thumb2 support on iOS; ARM support on iOS, Linux and NaCl.
|
||||
bool UseFastISel = false;
|
||||
UseFastISel |= Subtarget->isTargetIOS() && !Subtarget->isThumb1Only();
|
||||
UseFastISel |= Subtarget->isTargetMachO() && !Subtarget->isThumb1Only();
|
||||
UseFastISel |= Subtarget->isTargetLinux() && !Subtarget->isThumb();
|
||||
UseFastISel |= Subtarget->isTargetNaCl() && !Subtarget->isThumb();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user