summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-06-12 20:06:33 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-06-12 20:06:33 +0000
commit3455c40f918b7e869ed83420a7e84d01e2fccb9f (patch)
treeb64ea71f4553e1488892cf0ddf82b3d5181693bb /lib
parenta15b05e1aa18920a8f664a2af4c77874bc82474e (diff)
downloadllvm-3455c40f918b7e869ed83420a7e84d01e2fccb9f.tar.gz
llvm-3455c40f918b7e869ed83420a7e84d01e2fccb9f.tar.bz2
llvm-3455c40f918b7e869ed83420a7e84d01e2fccb9f.tar.xz
CodeGen: enable mov.w/mov.t pairs with minsize for WoA
Windows on ARM uses COFF/PE which is intrinsically position independent. For the case of 32-bit immediates, use a pair-wise relocation as otherwise we may exceed the range of operators. This fixes a code generation crash when using -Oz when targeting Windows on ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMSubtarget.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h
index 2694c34293..6abae8b3cd 100644
--- a/lib/Target/ARM/ARMSubtarget.h
+++ b/lib/Target/ARM/ARMSubtarget.h
@@ -379,7 +379,12 @@ public:
bool isR9Reserved() const { return IsR9Reserved; }
- bool useMovt() const { return UseMovt && !isMinSize(); }
+ bool useMovt() 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() || !isMinSize());
+ }
bool supportsTailCall() const { return SupportsTailCall; }
bool allowsUnalignedMem() const { return AllowsUnalignedMem; }