Revert "Change memcpy/memset/memmove to have dest and source alignments."
[oota-llvm.git] / test / Transforms / MetaRenamer / metarenamer.ll
1 ; RUN: opt -metarenamer -S < %s | FileCheck %s
2
3 ; CHECK: target triple {{.*}}
4 ; CHECK-NOT: {{^x*}}xxx{{^x*}}
5 ; CHECK: ret i32 6
6
7 target triple = "x86_64-pc-linux-gnu"
8
9 %struct.bar_xxx = type { i32, double }
10 %struct.foo_xxx = type { i32, float, %struct.bar_xxx }
11
12 @func_5_xxx.static_local_3_xxx = internal global i32 3, align 4
13 @global_3_xxx = common global i32 0, align 4
14
15 @func_7_xxx = weak alias i32 (...), i32 (...)* @aliased_func_7_xxx
16
17 define i32 @aliased_func_7_xxx(...) {
18   ret i32 0
19 }
20
21 define i32 @func_3_xxx() nounwind uwtable ssp {
22   ret i32 3
23 }
24
25 define void @func_4_xxx(%struct.foo_xxx* sret %agg.result) nounwind uwtable ssp {
26   %1 = alloca %struct.foo_xxx, align 8
27   %2 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 0
28   store i32 1, i32* %2, align 4
29   %3 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 1
30   store float 2.000000e+00, float* %3, align 4
31   %4 = getelementptr inbounds %struct.foo_xxx, %struct.foo_xxx* %1, i32 0, i32 2
32   %5 = getelementptr inbounds %struct.bar_xxx, %struct.bar_xxx* %4, i32 0, i32 0
33   store i32 3, i32* %5, align 4
34   %6 = getelementptr inbounds %struct.bar_xxx, %struct.bar_xxx* %4, i32 0, i32 1
35   store double 4.000000e+00, double* %6, align 8
36   %7 = bitcast %struct.foo_xxx* %agg.result to i8*
37   %8 = bitcast %struct.foo_xxx* %1 to i8*
38   call void @llvm.memcpy.p0i8.p0i8.i64(i8* %7, i8* %8, i64 24, i32 8, i1 false)
39   ret void
40 }
41
42 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
43
44 define i32 @func_5_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, i32 %arg_3_xxx, i32 %arg_4_xxx) nounwind uwtable ssp {
45   %1 = alloca i32, align 4
46   %2 = alloca i32, align 4
47   %3 = alloca i32, align 4
48   %4 = alloca i32, align 4
49   %local_1_xxx = alloca i32, align 4
50   %local_2_xxx = alloca i32, align 4
51   %i = alloca i32, align 4
52   store i32 %arg_1_xxx, i32* %1, align 4
53   store i32 %arg_2_xxx, i32* %2, align 4
54   store i32 %arg_3_xxx, i32* %3, align 4
55   store i32 %arg_4_xxx, i32* %4, align 4
56   store i32 1, i32* %local_1_xxx, align 4
57   store i32 2, i32* %local_2_xxx, align 4
58   store i32 0, i32* %i, align 4
59   br label %5
60
61 ; <label>:5                                       ; preds = %9, %0
62   %6 = load i32, i32* %i, align 4
63   %7 = icmp slt i32 %6, 10
64   br i1 %7, label %8, label %12
65
66 ; <label>:8                                       ; preds = %5
67   br label %9
68
69 ; <label>:9                                       ; preds = %8
70   %10 = load i32, i32* %i, align 4
71   %11 = add nsw i32 %10, 1
72   store i32 %11, i32* %i, align 4
73   br label %5
74
75 ; <label>:12                                      ; preds = %5
76   %13 = load i32, i32* %local_1_xxx, align 4
77   %14 = load i32, i32* %1, align 4
78   %15 = add nsw i32 %13, %14
79   %16 = load i32, i32* %local_2_xxx, align 4
80   %17 = add nsw i32 %15, %16
81   %18 = load i32, i32* %2, align 4
82   %19 = add nsw i32 %17, %18
83   %20 = load i32, i32* @func_5_xxx.static_local_3_xxx, align 4
84   %21 = add nsw i32 %19, %20
85   %22 = load i32, i32* %3, align 4
86   %23 = add nsw i32 %21, %22
87   %24 = load i32, i32* %4, align 4
88   %25 = add nsw i32 %23, %24
89   ret i32 %25
90 }
91
92 define i32 @varargs_func_6_xxx(i32 %arg_1_xxx, i32 %arg_2_xxx, ...) nounwind uwtable ssp {
93   %1 = alloca i32, align 4
94   %2 = alloca i32, align 4
95   store i32 %arg_1_xxx, i32* %1, align 4
96   store i32 %arg_2_xxx, i32* %2, align 4
97   ret i32 6
98 }