aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-03-09 19:15:00 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-03-09 19:15:00 +0000
commit6501153fc036741a90c616083014b0f8499678fb (patch)
treed6305cf624b26b5fa4fbe6f59c39008caa01eddb
parent0d8fc52ed37af612dae62868727b840b8936efb2 (diff)
ARM isLegalAddressImmediate should check if type is a simple type now that optimizer can create values of funky scalar types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66429 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMISelLowering.cpp3
-rw-r--r--test/CodeGen/ARM/2009-03-09-AddrModeBug.ll13
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp
index cc38efb9cc..a6674b2916 100644
--- a/lib/Target/ARM/ARMISelLowering.cpp
+++ b/lib/Target/ARM/ARMISelLowering.cpp
@@ -1591,6 +1591,9 @@ static bool isLegalAddressImmediate(int64_t V, MVT VT,
if (V == 0)
return true;
+ if (!VT.isSimple())
+ return false;
+
if (Subtarget->isThumb()) {
if (V < 0)
return false;
diff --git a/test/CodeGen/ARM/2009-03-09-AddrModeBug.ll b/test/CodeGen/ARM/2009-03-09-AddrModeBug.ll
new file mode 100644
index 0000000000..0ec6d7d4ff
--- /dev/null
+++ b/test/CodeGen/ARM/2009-03-09-AddrModeBug.ll
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | llc -march=arm
+
+ %struct.hit_t = type { %struct.v_t, double }
+ %struct.node_t = type { %struct.hit_t, %struct.hit_t, i32 }
+ %struct.v_t = type { double, double, double }
+
+define fastcc %struct.node_t* @_ZL6createP6node_tii3v_tS1_d(%struct.node_t* %n, i32 %lvl, i32 %dist, i64 %c.0.0, i64 %c.0.1, i64 %c.0.2, i64 %d.0.0, i64 %d.0.1, i64 %d.0.2, double %r) nounwind {
+entry:
+ %0 = getelementptr %struct.node_t* %n, i32 0, i32 1 ; <%struct.hit_t*> [#uses=1]
+ %1 = bitcast %struct.hit_t* %0 to i256* ; <i256*> [#uses=1]
+ store i256 0, i256* %1, align 4
+ unreachable
+}