1
1
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2
- ; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
3
- ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
2
+ ; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
3
+ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=11 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
4
4
; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
5
5
; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
6
6
7
7
;; This function returns its second argument on all return statements
8
8
define internal i32* @incdec (i1 %C , i32* %V ) {
9
- ; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn
9
+ ; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
10
10
; IS__TUNIT____-LABEL: define {{[^@]+}}@incdec
11
- ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull returned align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] {
12
- ; IS__TUNIT____-NEXT: [[X:%.*]] = load i32, i32* [[V]], align 4
11
+ ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* noalias nofree noundef nonnull returned writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[V:%.*]]) #[[ATTR0:[0-9]+]] {
13
12
; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
14
13
; IS__TUNIT____: T:
15
- ; IS__TUNIT____-NEXT: [[X1:%.*]] = add i32 [[X]], 1
16
- ; IS__TUNIT____-NEXT: store i32 [[X1]], i32* [[V]], align 4
17
14
; IS__TUNIT____-NEXT: ret i32* [[V]]
18
15
; IS__TUNIT____: F:
19
- ; IS__TUNIT____-NEXT: [[X2:%.*]] = sub i32 [[X]], 1
20
- ; IS__TUNIT____-NEXT: store i32 [[X2]], i32* [[V]], align 4
21
16
; IS__TUNIT____-NEXT: ret i32* [[V]]
22
17
;
23
18
; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn
@@ -51,13 +46,13 @@ F: ; preds = %0
51
46
;; This function returns its first argument as a part of a multiple return
52
47
;; value
53
48
define internal { i32 , i32 } @foo (i32 %A , i32 %B ) {
54
- ; CHECK : Function Attrs: nofree norecurse nosync nounwind readnone willreturn
55
- ; CHECK -LABEL: define {{[^@]+}}@foo
56
- ; CHECK -SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] {
57
- ; CHECK -NEXT: [[X:%.*]] = add i32 [[A]], [[B]]
58
- ; CHECK -NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0
59
- ; CHECK -NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1
60
- ; CHECK -NEXT: ret { i32, i32 } [[Z]]
49
+ ; IS__CGSCC____ : Function Attrs: nofree norecurse nosync nounwind readnone willreturn
50
+ ; IS__CGSCC____ -LABEL: define {{[^@]+}}@foo
51
+ ; IS__CGSCC____ -SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1:[0-9]+]] {
52
+ ; IS__CGSCC____ -NEXT: [[X:%.*]] = add i32 [[A]], [[B]]
53
+ ; IS__CGSCC____ -NEXT: [[Y:%.*]] = insertvalue { i32, i32 } undef, i32 [[A]], 0
54
+ ; IS__CGSCC____ -NEXT: [[Z:%.*]] = insertvalue { i32, i32 } [[Y]], i32 [[X]], 1
55
+ ; IS__CGSCC____ -NEXT: ret { i32, i32 } [[Z]]
61
56
;
62
57
%X = add i32 %A , %B
63
58
%Y = insertvalue { i32 , i32 } undef , i32 %A , 0
@@ -68,17 +63,11 @@ define internal { i32, i32 } @foo(i32 %A, i32 %B) {
68
63
define void @caller (i1 %C ) personality i32 (...)* @__gxx_personality_v0 {
69
64
; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
70
65
; IS__TUNIT____-LABEL: define {{[^@]+}}@caller
71
- ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] personality i32 (...)* @__gxx_personality_v0 {
66
+ ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1:[0-9]+ ]] personality i32 (...)* @__gxx_personality_v0 {
72
67
; IS__TUNIT____-NEXT: [[Q:%.*]] = alloca i32, align 4
73
- ; IS__TUNIT____-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]]
74
- ; IS__TUNIT____-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR3:[0-9]+]]
75
- ; IS__TUNIT____-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0
76
- ; IS__TUNIT____-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR3]]
68
+ ; IS__TUNIT____-NEXT: [[W:%.*]] = call align 4 i32* @incdec(i1 [[C]], i32* noalias nofree noundef nonnull writeonly align 4 dereferenceable(4) "no-capture-maybe-returned" [[Q]]) #[[ATTR2:[0-9]+]]
77
69
; IS__TUNIT____-NEXT: br label [[OK:%.*]]
78
70
; IS__TUNIT____: OK:
79
- ; IS__TUNIT____-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0
80
- ; IS__TUNIT____-NEXT: [[Z:%.*]] = add i32 [[X1]], [[X2]]
81
- ; IS__TUNIT____-NEXT: store i32 [[Z]], i32* [[Q]], align 4
82
71
; IS__TUNIT____-NEXT: br label [[RET:%.*]]
83
72
; IS__TUNIT____: LPAD:
84
73
; IS__TUNIT____-NEXT: unreachable
@@ -116,7 +105,6 @@ define void @caller(i1 %C) personality i32 (...)* @__gxx_personality_v0 {
116
105
117
106
OK:
118
107
%X2 = extractvalue { i32 , i32 } %S2 , 0
119
- ;; Do some stuff with the returned values which we can grep for
120
108
%Z = add i32 %X1 , %X2
121
109
store i32 %Z , i32* %W
122
110
br label %RET
@@ -132,10 +120,9 @@ RET:
132
120
133
121
declare i32 @__gxx_personality_v0 (...)
134
122
;.
135
- ; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn }
123
+ ; IS__TUNIT____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
136
124
; IS__TUNIT____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
137
- ; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn }
138
- ; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind readnone willreturn }
125
+ ; IS__TUNIT____: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn writeonly }
139
126
;.
140
127
; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn }
141
128
; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
0 commit comments