summaryrefslogtreecommitdiffstats
path: root/test/Transforms/ScalarRepl
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/ScalarRepl')
-rw-r--r--test/Transforms/ScalarRepl/2009-12-11-NeonTypes.ll4
-rw-r--r--test/Transforms/ScalarRepl/2010-01-18-SelfCopy.ll2
-rw-r--r--test/Transforms/ScalarRepl/address-space.ll35
-rw-r--r--test/Transforms/ScalarRepl/memcpy-align.ll2
4 files changed, 39 insertions, 4 deletions
diff --git a/test/Transforms/ScalarRepl/2009-12-11-NeonTypes.ll b/test/Transforms/ScalarRepl/2009-12-11-NeonTypes.ll
index 71f66d6..31d9bae 100644
--- a/test/Transforms/ScalarRepl/2009-12-11-NeonTypes.ll
+++ b/test/Transforms/ScalarRepl/2009-12-11-NeonTypes.ll
@@ -9,7 +9,7 @@ target triple = "thumbv7-apple-darwin10"
%struct.int16x8x2_t = type { [2 x %struct.int16x8_t] }
%union..0anon = type { %struct.int16x8x2_t }
-define arm_apcscc void @test(<8 x i16> %tmp.0, %struct.int16x8x2_t* %dst) nounwind {
+define void @test(<8 x i16> %tmp.0, %struct.int16x8x2_t* %dst) nounwind {
; CHECK: @test
; CHECK-NOT: alloca
; CHECK: "alloca point"
@@ -68,7 +68,7 @@ return: ; preds = %entry
; Radar 7466574
%struct._NSRange = type { i64 }
-define arm_apcscc void @test_memcpy_self() nounwind {
+define void @test_memcpy_self() nounwind {
; CHECK: @test_memcpy_self
; CHECK-NOT: alloca
; CHECK: br i1
diff --git a/test/Transforms/ScalarRepl/2010-01-18-SelfCopy.ll b/test/Transforms/ScalarRepl/2010-01-18-SelfCopy.ll
index 74cf251..3aee399 100644
--- a/test/Transforms/ScalarRepl/2010-01-18-SelfCopy.ll
+++ b/test/Transforms/ScalarRepl/2010-01-18-SelfCopy.ll
@@ -5,7 +5,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
%struct.test = type { [3 x double ] }
-define arm_apcscc void @test_memcpy_self() nounwind {
+define void @test_memcpy_self() nounwind {
; CHECK: @test_memcpy_self
; CHECK-NOT: alloca
; CHECK: ret void
diff --git a/test/Transforms/ScalarRepl/address-space.ll b/test/Transforms/ScalarRepl/address-space.ll
new file mode 100644
index 0000000..318d4e7
--- /dev/null
+++ b/test/Transforms/ScalarRepl/address-space.ll
@@ -0,0 +1,35 @@
+; RUN: opt -S -scalarrepl < %s | FileCheck %s
+; PR7437 - Make sure SROA preserves address space of memcpy when
+; hacking on it.
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-apple-darwin10"
+
+%struct.anon = type { [1 x float] }
+
+; CHECK: define void @Test(
+; CHECK: load float addrspace(2)*
+; CHECK-NEXT: fsub float
+; CHECK: store float {{.*}}, float addrspace(2)*
+define void @Test(%struct.anon addrspace(2)* %pPtr) nounwind {
+entry:
+ %s = alloca %struct.anon, align 4 ; <%struct.anon*> [#uses=3]
+ %arrayidx = getelementptr inbounds %struct.anon addrspace(2)* %pPtr, i64 0 ; <%struct.anon addrspace(2)*> [#uses=1]
+ %tmp1 = bitcast %struct.anon* %s to i8* ; <i8*> [#uses=1]
+ %tmp2 = bitcast %struct.anon addrspace(2)* %arrayidx to i8 addrspace(2)* ; <i8 addrspace(2)*> [#uses=1]
+ call void @llvm.memcpy.p0i8.p2i8.i64(i8* %tmp1, i8 addrspace(2)* %tmp2, i64 4, i32 4, i1 false)
+ %tmp3 = getelementptr inbounds %struct.anon* %s, i32 0, i32 0 ; <[1 x float]*> [#uses=1]
+ %arrayidx4 = getelementptr inbounds [1 x float]* %tmp3, i32 0, i64 0 ; <float*> [#uses=2]
+ %tmp5 = load float* %arrayidx4 ; <float> [#uses=1]
+ %sub = fsub float %tmp5, 5.000000e+00 ; <float> [#uses=1]
+ store float %sub, float* %arrayidx4
+ %arrayidx7 = getelementptr inbounds %struct.anon addrspace(2)* %pPtr, i64 0 ; <%struct.anon addrspace(2)*> [#uses=1]
+ %tmp8 = bitcast %struct.anon addrspace(2)* %arrayidx7 to i8 addrspace(2)* ; <i8 addrspace(2)*> [#uses=1]
+ %tmp9 = bitcast %struct.anon* %s to i8* ; <i8*> [#uses=1]
+ call void @llvm.memcpy.p2i8.p0i8.i64(i8 addrspace(2)* %tmp8, i8* %tmp9, i64 4, i32 4, i1 false)
+ ret void
+}
+
+declare void @llvm.memcpy.p0i8.p2i8.i64(i8* nocapture, i8 addrspace(2)* nocapture, i64, i32, i1) nounwind
+
+declare void @llvm.memcpy.p2i8.p0i8.i64(i8 addrspace(2)* nocapture, i8* nocapture, i64, i32, i1) nounwind
+
diff --git a/test/Transforms/ScalarRepl/memcpy-align.ll b/test/Transforms/ScalarRepl/memcpy-align.ll
index 91d354d..a7af208 100644
--- a/test/Transforms/ScalarRepl/memcpy-align.ll
+++ b/test/Transforms/ScalarRepl/memcpy-align.ll
@@ -9,7 +9,7 @@ target triple = "arm-u-u"
@c = external global %0 ; <%0*> [#uses=1]
-define arm_aapcscc void @good() nounwind {
+define void @good() nounwind {
entry:
%x0 = alloca %struct.anon, align 4 ; <%struct.anon*> [#uses=2]
%tmp = bitcast %struct.anon* %x0 to i8* ; <i8*> [#uses=1]
OpenPOWER on IntegriCloud