@@ -21,8 +21,8 @@ define void @caller_must_exec(i32* %p) {
21
21
ret void
22
22
}
23
23
24
- define internal i32 @callee_guaranteed_aligned (i1 %c , i32* %p ) {
25
- ; CHECK-LABEL: define {{[^@]+}}@callee_guaranteed_aligned
24
+ define internal i32 @callee_guaranteed_aligned_1 (i1 %c , i32* %p ) {
25
+ ; CHECK-LABEL: define {{[^@]+}}@callee_guaranteed_aligned_1
26
26
; CHECK-SAME: (i1 [[C:%.*]], i32 [[P_VAL:%.*]]) {
27
27
; CHECK-NEXT: br i1 [[C]], label [[IF:%.*]], label [[ELSE:%.*]]
28
28
; CHECK: if:
@@ -40,14 +40,44 @@ else:
40
40
ret i32 -1
41
41
}
42
42
43
- define void @caller_guaranteed_aligned (i1 %c , i32* align 16 dereferenceable (4 ) %p ) {
44
- ; CHECK-LABEL: define {{[^@]+}}@caller_guaranteed_aligned
43
+ define void @caller_guaranteed_aligned_1 (i1 %c , i32* align 16 dereferenceable (4 ) %p ) {
44
+ ; CHECK-LABEL: define {{[^@]+}}@caller_guaranteed_aligned_1
45
45
; CHECK-SAME: (i1 [[C:%.*]], i32* align 16 dereferenceable(4) [[P:%.*]]) {
46
46
; CHECK-NEXT: [[P_VAL:%.*]] = load i32, i32* [[P]], align 16
47
- ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @callee_guaranteed_aligned (i1 [[C]], i32 [[P_VAL]])
47
+ ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @callee_guaranteed_aligned_1 (i1 [[C]], i32 [[P_VAL]])
48
48
; CHECK-NEXT: ret void
49
49
;
50
- call i32 @callee_guaranteed_aligned (i1 %c , i32* %p )
50
+ call i32 @callee_guaranteed_aligned_1 (i1 %c , i32* %p )
51
+ ret void
52
+ }
53
+
54
+ define internal i32 @callee_guaranteed_aligned_2 (i1 %c , i32* align 16 dereferenceable (4 ) %p ) {
55
+ ; CHECK-LABEL: define {{[^@]+}}@callee_guaranteed_aligned_2
56
+ ; CHECK-SAME: (i1 [[C:%.*]], i32* align 16 dereferenceable(4) [[P:%.*]]) {
57
+ ; CHECK-NEXT: br i1 [[C]], label [[IF:%.*]], label [[ELSE:%.*]]
58
+ ; CHECK: if:
59
+ ; CHECK-NEXT: [[X:%.*]] = load i32, i32* [[P]], align 16
60
+ ; CHECK-NEXT: ret i32 [[X]]
61
+ ; CHECK: else:
62
+ ; CHECK-NEXT: ret i32 -1
63
+ ;
64
+ br i1 %c , label %if , label %else
65
+
66
+ if:
67
+ %x = load i32 , i32* %p , align 16
68
+ ret i32 %x
69
+
70
+ else:
71
+ ret i32 -1
72
+ }
73
+
74
+ define void @caller_guaranteed_aligned_2 (i1 %c , i32* %p ) {
75
+ ; CHECK-LABEL: define {{[^@]+}}@caller_guaranteed_aligned_2
76
+ ; CHECK-SAME: (i1 [[C:%.*]], i32* [[P:%.*]]) {
77
+ ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @callee_guaranteed_aligned_2(i1 [[C]], i32* [[P]])
78
+ ; CHECK-NEXT: ret void
79
+ ;
80
+ call i32 @callee_guaranteed_aligned_2 (i1 %c , i32* %p )
51
81
ret void
52
82
}
53
83
0 commit comments