blob: 56757a6d1f8bf0d22aee91a31bcb6aadc1633e17 [file] [log] [blame]
Chris Lattnerfd51c522010-12-09 07:39:50 +00001; RUN: opt < %s -basicaa -memcpyopt -disable-output
Chris Lattnerf2ab40a2009-09-08 00:27:14 +00002
3target datalayout = "e-p:32:32:32-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"
4target triple = "armv7-eabi"
5
6%struct.qw = type { [4 x float] }
7%struct.bar = type { %struct.qw, %struct.qw, %struct.qw, %struct.qw, %struct.qw, float, float}
8
Chris Lattnerfd51c522010-12-09 07:39:50 +00009; PR4882
10define void @test1(%struct.bar* %this) {
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000011entry:
David Blaikie79e6c742015-02-27 19:29:02 +000012 %0 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 0, i32 0, i32 0
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000013 store float 0.000000e+00, float* %0, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000014 %1 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 0, i32 0, i32 1
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000015 store float 0.000000e+00, float* %1, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000016 %2 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 0, i32 0, i32 2
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000017 store float 0.000000e+00, float* %2, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000018 %3 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 0, i32 0, i32 3
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000019 store float 0.000000e+00, float* %3, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000020 %4 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 1, i32 0, i32 0
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000021 store float 0.000000e+00, float* %4, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000022 %5 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 1, i32 0, i32 1
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000023 store float 0.000000e+00, float* %5, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000024 %6 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 1, i32 0, i32 2
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000025 store float 0.000000e+00, float* %6, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000026 %7 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 1, i32 0, i32 3
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000027 store float 0.000000e+00, float* %7, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000028 %8 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 3, i32 0, i32 1
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000029 store float 0.000000e+00, float* %8, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000030 %9 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 3, i32 0, i32 2
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000031 store float 0.000000e+00, float* %9, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000032 %10 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 3, i32 0, i32 3
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000033 store float 0.000000e+00, float* %10, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000034 %11 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 4, i32 0, i32 0
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000035 store float 0.000000e+00, float* %11, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000036 %12 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 4, i32 0, i32 1
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000037 store float 0.000000e+00, float* %12, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000038 %13 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 4, i32 0, i32 2
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000039 store float 0.000000e+00, float* %13, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000040 %14 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 4, i32 0, i32 3
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000041 store float 0.000000e+00, float* %14, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000042 %15 = getelementptr inbounds %struct.bar, %struct.bar* %this, i32 0, i32 5
Chris Lattnerf2ab40a2009-09-08 00:27:14 +000043 store float 0.000000e+00, float* %15, align 4
44 unreachable
45}
Chris Lattnerfd51c522010-12-09 07:39:50 +000046
47; PR8753
48
49declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32,
50i1) nounwind
51
52define void @test2(i32 %cmd) nounwind {
53 call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* undef, i64 20, i32 1, i1
54false) nounwind
55 call void @llvm.memcpy.p0i8.p0i8.i64(i8* null, i8* undef, i64 20, i32 1, i1
56false) nounwind
57 ret void
58}