1a2223612SMichael Kruse // Check code generation
2532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -verify -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=51 -emit-llvm %s -o - | FileCheck %s --check-prefix=IR
3a2223612SMichael Kruse
4a2223612SMichael Kruse // Check same results after serialization round-trip
5532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -verify -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=51 -emit-pch -o %t %s
6532dc62bSNikita Popov // RUN: %clang_cc1 -no-opaque-pointers -verify -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=51 -include-pch %t -emit-llvm %s -o - | FileCheck %s --check-prefix=IR
7a2223612SMichael Kruse // expected-no-diagnostics
8a2223612SMichael Kruse
9a2223612SMichael Kruse #ifndef HEADER
10a2223612SMichael Kruse #define HEADER
11a2223612SMichael Kruse
12a2223612SMichael Kruse // placeholder for loop body code.
body(...)13a2223612SMichael Kruse extern "C" void body(...) {}
14a2223612SMichael Kruse
15a2223612SMichael Kruse
16a2223612SMichael Kruse // IR-LABEL: @func(
17ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[ENTRY:.*]]:
18ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[START_ADDR:.+]] = alloca i32, align 4
19ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[END_ADDR:.+]] = alloca i32, align 4
20ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[STEP_ADDR:.+]] = alloca i32, align 4
21ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[START:.+]], i32* %[[START_ADDR]], align 4
22ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[END:.+]], i32* %[[END_ADDR]], align 4
23ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[STEP:.+]], i32* %[[STEP_ADDR]], align 4
24ac90dfc4SGiorgis Georgakoudis // IR-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @2, i32 3, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32*, i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*), i32* %[[END_ADDR]], i32* %[[STEP_ADDR]], i32* %[[START_ADDR]])
25a2223612SMichael Kruse // IR-NEXT: ret void
26ac90dfc4SGiorgis Georgakoudis // IR-NEXT: }
func(int start,int end,int step)27a2223612SMichael Kruse extern "C" void func(int start, int end, int step) {
28a2223612SMichael Kruse #pragma omp parallel for
29a2223612SMichael Kruse #pragma omp unroll partial(7)
30a2223612SMichael Kruse for (int i = start; i < end; i+=step)
31a2223612SMichael Kruse body(start, end, step, i);
32a2223612SMichael Kruse }
33a2223612SMichael Kruse
34a2223612SMichael Kruse
35ac90dfc4SGiorgis Georgakoudis // IR-LABEL: @.omp_outlined.(
36ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[ENTRY:.*]]:
37ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTGLOBAL_TID__ADDR:.+]] = alloca i32*, align 8
38ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTBOUND_TID__ADDR:.+]] = alloca i32*, align 8
39ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[END_ADDR:.+]] = alloca i32*, align 8
40ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[STEP_ADDR:.+]] = alloca i32*, align 8
41ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[START_ADDR:.+]] = alloca i32*, align 8
42ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTOMP_IV:.+]] = alloca i32, align 4
43ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP:.+]] = alloca i32, align 4
44ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[I:.+]] = alloca i32, align 4
45ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTCAPTURE_EXPR_:.+]] = alloca i32, align 4
46ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTCAPTURE_EXPR_1:.+]] = alloca i32, align 4
47ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTCAPTURE_EXPR_2:.+]] = alloca i32, align 4
48ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTCAPTURE_EXPR_3:.+]] = alloca i32, align 4
49ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTCAPTURE_EXPR_6:.+]] = alloca i32, align 4
50ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTCAPTURE_EXPR_8:.+]] = alloca i32, align 4
51ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTUNROLLED_IV_I:.+]] = alloca i32, align 4
52ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTOMP_LB:.+]] = alloca i32, align 4
53ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTOMP_UB:.+]] = alloca i32, align 4
54ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTOMP_STRIDE:.+]] = alloca i32, align 4
55ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTOMP_IS_LAST:.+]] = alloca i32, align 4
56ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTUNROLLED_IV_I12:.+]] = alloca i32, align 4
57ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DOTUNROLL_INNER_IV_I:.+]] = alloca i32, align 4
58ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32* %[[DOTGLOBAL_TID_:.+]], i32** %[[DOTGLOBAL_TID__ADDR]], align 8
59ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32* %[[DOTBOUND_TID_:.+]], i32** %[[DOTBOUND_TID__ADDR]], align 8
60ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32* %[[END:.+]], i32** %[[END_ADDR]], align 8
61ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32* %[[STEP:.+]], i32** %[[STEP_ADDR]], align 8
62ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32* %[[START:.+]], i32** %[[START_ADDR]], align 8
63ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP0:.+]] = load i32*, i32** %[[END_ADDR]], align 8
64ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP1:.+]] = load i32*, i32** %[[STEP_ADDR]], align 8
65ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP2:.+]] = load i32*, i32** %[[START_ADDR]], align 8
66ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP3:.+]] = load i32, i32* %[[TMP2]], align 4
67ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[TMP3]], i32* %[[I]], align 4
68ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP4:.+]] = load i32, i32* %[[TMP2]], align 4
69ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[TMP4]], i32* %[[DOTCAPTURE_EXPR_]], align 4
70ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP5:.+]] = load i32, i32* %[[TMP0]], align 4
71ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[TMP5]], i32* %[[DOTCAPTURE_EXPR_1]], align 4
72ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP6:.+]] = load i32, i32* %[[TMP1]], align 4
73ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[TMP6]], i32* %[[DOTCAPTURE_EXPR_2]], align 4
74ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP7:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_1]], align 4
75ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP8:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_]], align 4
76ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[SUB:.+]] = sub i32 %[[TMP7]], %[[TMP8]]
77ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[SUB4:.+]] = sub i32 %[[SUB]], 1
78ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP9:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_2]], align 4
79ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[ADD:.+]] = add i32 %[[SUB4]], %[[TMP9]]
80ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP10:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_2]], align 4
81ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DIV:.+]] = udiv i32 %[[ADD]], %[[TMP10]]
82ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[SUB5:.+]] = sub i32 %[[DIV]], 1
83ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[SUB5]], i32* %[[DOTCAPTURE_EXPR_3]], align 4
84ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP11:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_3]], align 4
85ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[ADD7:.+]] = add i32 %[[TMP11]], 1
86ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[ADD7]], i32* %[[DOTCAPTURE_EXPR_6]], align 4
87ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP12:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_6]], align 4
88ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[SUB9:.+]] = sub i32 %[[TMP12]], -6
89ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[DIV10:.+]] = udiv i32 %[[SUB9]], 7
90ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[SUB11:.+]] = sub i32 %[[DIV10]], 1
91ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[SUB11]], i32* %[[DOTCAPTURE_EXPR_8]], align 4
92ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 0, i32* %[[DOTUNROLLED_IV_I]], align 4
93ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP13:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_6]], align 4
94ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[CMP:.+]] = icmp ult i32 0, %[[TMP13]]
95ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br i1 %[[CMP]], label %[[OMP_PRECOND_THEN:.+]], label %[[OMP_PRECOND_END:.+]]
96ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
97ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[OMP_PRECOND_THEN]]:
98ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 0, i32* %[[DOTOMP_LB]], align 4
99ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP14:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_8]], align 4
100ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[TMP14]], i32* %[[DOTOMP_UB]], align 4
101ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 1, i32* %[[DOTOMP_STRIDE]], align 4
102ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 0, i32* %[[DOTOMP_IS_LAST]], align 4
103ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP15:.+]] = load i32*, i32** %[[DOTGLOBAL_TID__ADDR]], align 8
104ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP16:.+]] = load i32, i32* %[[TMP15]], align 4
105ac90dfc4SGiorgis Georgakoudis // IR-NEXT: call void @__kmpc_for_static_init_4u(%struct.ident_t* @1, i32 %[[TMP16]], i32 34, i32* %[[DOTOMP_IS_LAST]], i32* %[[DOTOMP_LB]], i32* %[[DOTOMP_UB]], i32* %[[DOTOMP_STRIDE]], i32 1, i32 1)
106ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP17:.+]] = load i32, i32* %[[DOTOMP_UB]], align 4
107ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP18:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_8]], align 4
108ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[CMP13:.+]] = icmp ugt i32 %[[TMP17]], %[[TMP18]]
109ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br i1 %[[CMP13]], label %[[COND_TRUE:.+]], label %[[COND_FALSE:.+]]
110ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
111ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[COND_TRUE]]:
112ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP19:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_8]], align 4
113ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[COND_END:.+]]
114ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
115ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[COND_FALSE]]:
116ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP20:.+]] = load i32, i32* %[[DOTOMP_UB]], align 4
117ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[COND_END]]
118ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
119ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[COND_END]]:
120ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[COND:.+]] = phi i32 [ %[[TMP19]], %[[COND_TRUE]] ], [ %[[TMP20]], %[[COND_FALSE]] ]
121ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[COND]], i32* %[[DOTOMP_UB]], align 4
122ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP21:.+]] = load i32, i32* %[[DOTOMP_LB]], align 4
123ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[TMP21]], i32* %[[DOTOMP_IV]], align 4
124ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[OMP_INNER_FOR_COND:.+]]
125ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
126ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[OMP_INNER_FOR_COND]]:
127ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP22:.+]] = load i32, i32* %[[DOTOMP_IV]], align 4
128ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP23:.+]] = load i32, i32* %[[DOTOMP_UB]], align 4
129ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[ADD14:.+]] = add i32 %[[TMP23]], 1
130ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[CMP15:.+]] = icmp ult i32 %[[TMP22]], %[[ADD14]]
131ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br i1 %[[CMP15]], label %[[OMP_INNER_FOR_BODY:.+]], label %[[OMP_INNER_FOR_END:.+]]
132ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
133ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[OMP_INNER_FOR_BODY]]:
134ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP24:.+]] = load i32, i32* %[[DOTOMP_IV]], align 4
135ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[MUL:.+]] = mul i32 %[[TMP24]], 7
136ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[ADD16:.+]] = add i32 0, %[[MUL]]
137ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[ADD16]], i32* %[[DOTUNROLLED_IV_I12]], align 4
138ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP25:.+]] = load i32, i32* %[[DOTUNROLLED_IV_I12]], align 4
139ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[TMP25]], i32* %[[DOTUNROLL_INNER_IV_I]], align 4
140ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[FOR_COND:.+]]
141ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
142ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[FOR_COND]]:
143ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP26:.+]] = load i32, i32* %[[DOTUNROLL_INNER_IV_I]], align 4
144ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP27:.+]] = load i32, i32* %[[DOTUNROLLED_IV_I12]], align 4
145ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[ADD17:.+]] = add i32 %[[TMP27]], 7
146*acec0700SMichael Kruse // IR-NEXT: %[[CMP18:.+]] = icmp ult i32 %[[TMP26]], %[[ADD17]]
147ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br i1 %[[CMP18]], label %[[LAND_RHS:.+]], label %[[LAND_END:.+]]
148ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
149ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[LAND_RHS]]:
150ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP28:.+]] = load i32, i32* %[[DOTUNROLL_INNER_IV_I]], align 4
151ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP29:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_3]], align 4
152ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[ADD19:.+]] = add i32 %[[TMP29]], 1
153*acec0700SMichael Kruse // IR-NEXT: %[[CMP20:.+]] = icmp ult i32 %[[TMP28]], %[[ADD19]]
154ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[LAND_END]]
155ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
156ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[LAND_END]]:
157ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP30:.+]] = phi i1 [ false, %[[FOR_COND]] ], [ %[[CMP20]], %[[LAND_RHS]] ]
158ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br i1 %[[TMP30]], label %[[FOR_BODY:.+]], label %[[FOR_END:.+]]
159ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
160ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[FOR_BODY]]:
161ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP31:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_]], align 4
162ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP32:.+]] = load i32, i32* %[[DOTUNROLL_INNER_IV_I]], align 4
163ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP33:.+]] = load i32, i32* %[[DOTCAPTURE_EXPR_2]], align 4
164ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[MUL21:.+]] = mul i32 %[[TMP32]], %[[TMP33]]
165ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[ADD22:.+]] = add i32 %[[TMP31]], %[[MUL21]]
166ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[ADD22]], i32* %[[I]], align 4
167ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP34:.+]] = load i32, i32* %[[TMP2]], align 4
168ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP35:.+]] = load i32, i32* %[[TMP0]], align 4
169ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP36:.+]] = load i32, i32* %[[TMP1]], align 4
170ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP37:.+]] = load i32, i32* %[[I]], align 4
1711b1c8d83Shyeongyu kim // IR-NEXT: call void (...) @body(i32 noundef %[[TMP34]], i32 noundef %[[TMP35]], i32 noundef %[[TMP36]], i32 noundef %[[TMP37]])
172ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[FOR_INC:.+]]
173ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
174ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[FOR_INC]]:
175ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP38:.+]] = load i32, i32* %[[DOTUNROLL_INNER_IV_I]], align 4
176ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[INC:.+]] = add i32 %[[TMP38]], 1
177ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[INC]], i32* %[[DOTUNROLL_INNER_IV_I]], align 4
178ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[FOR_COND]], !llvm.loop ![[LOOP2:[0-9]+]]
179ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
180ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[FOR_END]]:
181ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[OMP_BODY_CONTINUE:.+]]
182ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
183ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[OMP_BODY_CONTINUE]]:
184ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[OMP_INNER_FOR_INC:.+]]
185ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
186ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[OMP_INNER_FOR_INC]]:
187ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP39:.+]] = load i32, i32* %[[DOTOMP_IV]], align 4
188ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[ADD23:.+]] = add i32 %[[TMP39]], 1
189ac90dfc4SGiorgis Georgakoudis // IR-NEXT: store i32 %[[ADD23]], i32* %[[DOTOMP_IV]], align 4
190ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[OMP_INNER_FOR_COND]]
191ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
192ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[OMP_INNER_FOR_END]]:
193ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[OMP_LOOP_EXIT:.+]]
194ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
195ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[OMP_LOOP_EXIT]]:
196ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP40:.+]] = load i32*, i32** %[[DOTGLOBAL_TID__ADDR]], align 8
197ac90dfc4SGiorgis Georgakoudis // IR-NEXT: %[[TMP41:.+]] = load i32, i32* %[[TMP40]], align 4
198ac90dfc4SGiorgis Georgakoudis // IR-NEXT: call void @__kmpc_for_static_fini(%struct.ident_t* @1, i32 %[[TMP41]])
199ac90dfc4SGiorgis Georgakoudis // IR-NEXT: br label %[[OMP_PRECOND_END]]
200ac90dfc4SGiorgis Georgakoudis // IR-EMPTY:
201ac90dfc4SGiorgis Georgakoudis // IR-NEXT: [[OMP_PRECOND_END]]:
202ac90dfc4SGiorgis Georgakoudis // IR-NEXT: ret void
203ac90dfc4SGiorgis Georgakoudis // IR-NEXT: }
204a2223612SMichael Kruse
205a2223612SMichael Kruse #endif /* HEADER */
206a2223612SMichael Kruse
207a2223612SMichael Kruse
208ac90dfc4SGiorgis Georgakoudis // IR: ![[LOOP2]] = distinct !{![[LOOP2]], ![[LOOPPROP3:[0-9]+]], ![[LOOPPROP4:[0-9]+]]}
209ac90dfc4SGiorgis Georgakoudis // IR: ![[LOOPPROP3]] = !{!"llvm.loop.mustprogress"}
210ac90dfc4SGiorgis Georgakoudis // IR: ![[LOOPPROP4]] = !{!"llvm.loop.unroll.count", i32 7}
211