aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/vector-DAGCombine.ll
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-12-21 06:43:19 +0000
committerBob Wilson <bob.wilson@apple.com>2010-12-21 06:43:19 +0000
commit316009054ef25fd12f95d97ac9282dede2392e1a (patch)
tree3a1e918c24708a60e0ed4ce9efe055065673b09e /test/CodeGen/ARM/vector-DAGCombine.ll
parent62b83b62f377ac248038672015dc65970327f786 (diff)
Add ARM-specific DAG combining to cast i64 vector element load/stores to f64.
Type legalization splits up i64 values into pairs of i32 values, which leads to poor quality code when inserting or extracting i64 vector elements. If the vector element is loaded or stored, it can be treated as an f64 value and loaded or stored directly from a VPR register. Use the pre-legalization DAG combiner to cast those vector elements to f64 types so that the type legalizer won't mess them up. Radar 8755338. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122319 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM/vector-DAGCombine.ll')
-rw-r--r--test/CodeGen/ARM/vector-DAGCombine.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/vector-DAGCombine.ll b/test/CodeGen/ARM/vector-DAGCombine.ll
index ab4369f66a..a8894036f2 100644
--- a/test/CodeGen/ARM/vector-DAGCombine.ll
+++ b/test/CodeGen/ARM/vector-DAGCombine.ll
@@ -75,3 +75,33 @@ entry:
}
declare void @llvm.arm.neon.vst1.v8i8(i8*, <8 x i8>, i32) nounwind
+
+; Test that loads and stores of i64 vector elements are handled as f64 values
+; so they are not split up into i32 values. Radar 8755338.
+define void @i64_buildvector(i64* %ptr, <2 x i64>* %vp) nounwind {
+; CHECK: i64_buildvector
+; CHECK: vldr.64
+ %t0 = load i64* %ptr, align 4
+ %t1 = insertelement <2 x i64> undef, i64 %t0, i32 0
+ store <2 x i64> %t1, <2 x i64>* %vp
+ ret void
+}
+
+define void @i64_insertelement(i64* %ptr, <2 x i64>* %vp) nounwind {
+; CHECK: i64_insertelement
+; CHECK: vldr.64
+ %t0 = load i64* %ptr, align 4
+ %vec = load <2 x i64>* %vp
+ %t1 = insertelement <2 x i64> %vec, i64 %t0, i32 0
+ store <2 x i64> %t1, <2 x i64>* %vp
+ ret void
+}
+
+define void @i64_extractelement(i64* %ptr, <2 x i64>* %vp) nounwind {
+; CHECK: i64_extractelement
+; CHECK: vstr.64
+ %vec = load <2 x i64>* %vp
+ %t1 = extractelement <2 x i64> %vec, i32 0
+ store i64 %t1, i64* %ptr
+ ret void
+}