summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
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
commit65ca57a41815af432ff428d3383b0c23d0ea7677 (patch)
treea25fe18d2e6ce6c9196f065ce070d6e6afeff468 /llvm/lib/Target/ARM
parenta766029b81937aafb0ee7e83a6252e51eb1f9c34 (diff)
downloadbcm5719-llvm-65ca57a41815af432ff428d3383b0c23d0ea7677.tar.gz
bcm5719-llvm-65ca57a41815af432ff428d3383b0c23d0ea7677.zip
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. llvm-svn: 210814
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h
index 2694c34293a..6abae8b3cde 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.h
+++ b/llvm/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; }
OpenPOWER on IntegriCloud