alloca.ll
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
; RUN: opt -mergefunc -S < %s | FileCheck %s
;; Make sure that two different allocas are not treated as equal.
target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
%kv1 = type { i32, i32 }
%kv2 = type { i8 }
%kv3 = type { i64, i64 }
; Size difference.
; CHECK-LABEL: define void @size1
; CHECK-NOT: call void @
define void @size1(i8 *%f) {
%v = alloca %kv1, align 8
%f_2 = bitcast i8* %f to void (%kv1 *)*
call void %f_2(%kv1 * %v)
call void %f_2(%kv1 * %v)
call void %f_2(%kv1 * %v)
call void %f_2(%kv1 * %v)
ret void
}
; CHECK-LABEL: define void @size2
; CHECK-NOT: call void @
define void @size2(i8 *%f) {
%v = alloca %kv2, align 8
%f_2 = bitcast i8* %f to void (%kv2 *)*
call void %f_2(%kv2 * %v)
call void %f_2(%kv2 * %v)
call void %f_2(%kv2 * %v)
call void %f_2(%kv2 * %v)
ret void
}
; Alignment difference.
; CHECK-LABEL: define void @align1
; CHECK-NOT: call void @
define void @align1(i8 *%f) {
%v = alloca %kv3, align 8
%f_2 = bitcast i8* %f to void (%kv3 *)*
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
ret void
}
; CHECK-LABEL: define void @align2
; CHECK-NOT: call void @
define void @align2(i8 *%f) {
%v = alloca %kv3, align 16
%f_2 = bitcast i8* %f to void (%kv3 *)*
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
call void %f_2(%kv3 * %v)
ret void
}