1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
2 // expected-no-diagnostics
6 // RUN: %clang_cc1 -DCK1 -verify -Wno-vla -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1
7 // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
8 // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK1
9 // RUN: %clang_cc1 -DCK1 -verify -Wno-vla -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK3
10 // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
11 // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK3
13 // RUN: %clang_cc1 -DCK1 -verify -Wno-vla -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK5
14 // RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
15 // RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK5
16 // RUN: %clang_cc1 -DCK1 -verify -Wno-vla -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK7
17 // RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
18 // RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK7
23 int teams_argument_global(int n
) {
27 // discard n_addr and i
31 #pragma omp teams distribute simd num_teams(te), thread_limit(th) aligned(a) simdlen(16) linear(i)
32 for(i
= 0; i
< n
; i
++) {
38 #pragma omp teams distribute simd safelen(32)
39 for(int i
= 0; i
< n
; i
++) {
44 // outlined target regions
56 // RUN: %clang_cc1 -DCK2 -verify -Wno-vla -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK9
57 // RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
58 // RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK9
59 // RUN: %clang_cc1 -DCK2 -verify -Wno-vla -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK11
60 // RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
61 // RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK11
63 // RUN: %clang_cc1 -DCK2 -verify -Wno-vla -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK13
64 // RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
65 // RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK13
66 // RUN: %clang_cc1 -DCK2 -verify -Wno-vla -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK15
67 // RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
68 // RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK15
71 int teams_local_arg(void) {
76 #pragma omp teams distribute simd
77 for(int i
= 0; i
< n
; i
++) {
81 // outlined target region
89 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK17
90 // RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
91 // RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK17
92 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK19
93 // RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
94 // RUN: %clang_cc1 -DCK3 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK19
95 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK21
96 // RUN: %clang_cc1 -DCK3 -fopenmp -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
97 // RUN: %clang_cc1 -DCK3 -fopenmp -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK21
98 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK23
99 // RUN: %clang_cc1 -DCK3 -fopenmp -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
100 // RUN: %clang_cc1 -DCK3 -fopenmp -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK23
102 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK25
103 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
104 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK25
105 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK27
106 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
107 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK27
108 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp-simd -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK29
109 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
110 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK29
111 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp-simd -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK31
112 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
113 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK31
117 template <typename T
, int X
, long long Y
>
125 #pragma omp teams distribute simd if(b) nontemporal(a, b)
127 #pragma omp teams distribute simd
129 for(int i
= 0; i
< X
; i
++) {
133 // outlined target region
140 int teams_template_struct(void) {
147 // Test host codegen.
148 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK33
149 // RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
150 // RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK33
151 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK35
152 // RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
153 // RUN: %clang_cc1 -DCK4 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK35
154 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK37
155 // RUN: %clang_cc1 -DCK4 -fopenmp -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
156 // RUN: %clang_cc1 -DCK4 -fopenmp -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK37
157 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK39
158 // RUN: %clang_cc1 -DCK4 -fopenmp -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
159 // RUN: %clang_cc1 -DCK4 -fopenmp -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK39
161 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK41
162 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
163 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK41
164 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK43
165 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
166 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK43
167 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp-simd -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK45
168 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -DOMP5 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
169 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -DOMP5 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK45
170 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp-simd -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK47
171 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -DOMP5 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
172 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -DOMP5 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK47
176 template <typename T
, int n
>
182 #pragma omp teams distribute simd num_teams(te) thread_limit(th)
183 for(int i
= 0; i
< n
; i
++) {
189 int main (int argc
, char **argv
) {
194 #pragma omp teams distribute simd if(simd:argc)
196 #pragma omp teams distribute simd
198 for(int i
= 0; i
< n
; i
++) {
201 return tmain
<int, 10>(argc
);
210 // OMP5_50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
213 // CHECK1-LABEL: define {{[^@]+}}@_Z21teams_argument_globali
214 // CHECK1-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
215 // CHECK1-NEXT: entry:
216 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
217 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
218 // CHECK1-NEXT: [[TE:%.*]] = alloca i32, align 4
219 // CHECK1-NEXT: [[TH:%.*]] = alloca i32, align 4
220 // CHECK1-NEXT: [[TE_CASTED:%.*]] = alloca i64, align 8
221 // CHECK1-NEXT: [[TH_CASTED:%.*]] = alloca i64, align 8
222 // CHECK1-NEXT: [[I_CASTED:%.*]] = alloca i64, align 8
223 // CHECK1-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
224 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [5 x ptr], align 8
225 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [5 x ptr], align 8
226 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [5 x ptr], align 8
227 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
228 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
229 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
230 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
231 // CHECK1-NEXT: [[N_CASTED4:%.*]] = alloca i64, align 8
232 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS5:%.*]] = alloca [2 x ptr], align 8
233 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS6:%.*]] = alloca [2 x ptr], align 8
234 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS7:%.*]] = alloca [2 x ptr], align 8
235 // CHECK1-NEXT: [[_TMP8:%.*]] = alloca i32, align 4
236 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32, align 4
237 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_10:%.*]] = alloca i32, align 4
238 // CHECK1-NEXT: [[KERNEL_ARGS15:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
239 // CHECK1-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
240 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[N_ADDR]], align 4
241 // CHECK1-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP0]], 128
242 // CHECK1-NEXT: store i32 [[DIV]], ptr [[TE]], align 4
243 // CHECK1-NEXT: store i32 128, ptr [[TH]], align 4
244 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE]], align 4
245 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[TE_CASTED]], align 4
246 // CHECK1-NEXT: [[TMP2:%.*]] = load i64, ptr [[TE_CASTED]], align 8
247 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH]], align 4
248 // CHECK1-NEXT: store i32 [[TMP3]], ptr [[TH_CASTED]], align 4
249 // CHECK1-NEXT: [[TMP4:%.*]] = load i64, ptr [[TH_CASTED]], align 8
250 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4
251 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[I_CASTED]], align 4
252 // CHECK1-NEXT: [[TMP6:%.*]] = load i64, ptr [[I_CASTED]], align 8
253 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[N_ADDR]], align 4
254 // CHECK1-NEXT: store i32 [[TMP7]], ptr [[N_CASTED]], align 4
255 // CHECK1-NEXT: [[TMP8:%.*]] = load i64, ptr [[N_CASTED]], align 8
256 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
257 // CHECK1-NEXT: store i64 [[TMP2]], ptr [[TMP9]], align 8
258 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
259 // CHECK1-NEXT: store i64 [[TMP2]], ptr [[TMP10]], align 8
260 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
261 // CHECK1-NEXT: store ptr null, ptr [[TMP11]], align 8
262 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
263 // CHECK1-NEXT: store i64 [[TMP4]], ptr [[TMP12]], align 8
264 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
265 // CHECK1-NEXT: store i64 [[TMP4]], ptr [[TMP13]], align 8
266 // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
267 // CHECK1-NEXT: store ptr null, ptr [[TMP14]], align 8
268 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
269 // CHECK1-NEXT: store ptr @a, ptr [[TMP15]], align 8
270 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
271 // CHECK1-NEXT: store ptr @a, ptr [[TMP16]], align 8
272 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
273 // CHECK1-NEXT: store ptr null, ptr [[TMP17]], align 8
274 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
275 // CHECK1-NEXT: store i64 [[TMP6]], ptr [[TMP18]], align 8
276 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
277 // CHECK1-NEXT: store i64 [[TMP6]], ptr [[TMP19]], align 8
278 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 3
279 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
280 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 4
281 // CHECK1-NEXT: store i64 [[TMP8]], ptr [[TMP21]], align 8
282 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 4
283 // CHECK1-NEXT: store i64 [[TMP8]], ptr [[TMP22]], align 8
284 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 4
285 // CHECK1-NEXT: store ptr null, ptr [[TMP23]], align 8
286 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
287 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
288 // CHECK1-NEXT: [[TMP26:%.*]] = load i32, ptr [[TE]], align 4
289 // CHECK1-NEXT: [[TMP27:%.*]] = load i32, ptr [[TH]], align 4
290 // CHECK1-NEXT: [[TMP28:%.*]] = icmp ult i32 [[TMP27]], 1
291 // CHECK1-NEXT: [[TMP29:%.*]] = select i1 [[TMP28]], i32 [[TMP27]], i32 1
292 // CHECK1-NEXT: [[TMP30:%.*]] = load i32, ptr [[N_ADDR]], align 4
293 // CHECK1-NEXT: store i32 [[TMP30]], ptr [[DOTCAPTURE_EXPR_]], align 4
294 // CHECK1-NEXT: [[TMP31:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
295 // CHECK1-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP31]], 0
296 // CHECK1-NEXT: [[DIV2:%.*]] = sdiv i32 [[SUB]], 1
297 // CHECK1-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV2]], 1
298 // CHECK1-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
299 // CHECK1-NEXT: [[TMP32:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
300 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP32]], 1
301 // CHECK1-NEXT: [[TMP33:%.*]] = zext i32 [[ADD]] to i64
302 // CHECK1-NEXT: [[TMP34:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP26]], 0
303 // CHECK1-NEXT: [[TMP35:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP29]], 0
304 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
305 // CHECK1-NEXT: store i32 3, ptr [[TMP36]], align 4
306 // CHECK1-NEXT: [[TMP37:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
307 // CHECK1-NEXT: store i32 5, ptr [[TMP37]], align 4
308 // CHECK1-NEXT: [[TMP38:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
309 // CHECK1-NEXT: store ptr [[TMP24]], ptr [[TMP38]], align 8
310 // CHECK1-NEXT: [[TMP39:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
311 // CHECK1-NEXT: store ptr [[TMP25]], ptr [[TMP39]], align 8
312 // CHECK1-NEXT: [[TMP40:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
313 // CHECK1-NEXT: store ptr @.offload_sizes, ptr [[TMP40]], align 8
314 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
315 // CHECK1-NEXT: store ptr @.offload_maptypes, ptr [[TMP41]], align 8
316 // CHECK1-NEXT: [[TMP42:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
317 // CHECK1-NEXT: store ptr null, ptr [[TMP42]], align 8
318 // CHECK1-NEXT: [[TMP43:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
319 // CHECK1-NEXT: store ptr null, ptr [[TMP43]], align 8
320 // CHECK1-NEXT: [[TMP44:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
321 // CHECK1-NEXT: store i64 [[TMP33]], ptr [[TMP44]], align 8
322 // CHECK1-NEXT: [[TMP45:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
323 // CHECK1-NEXT: store i64 0, ptr [[TMP45]], align 8
324 // CHECK1-NEXT: [[TMP46:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
325 // CHECK1-NEXT: store [3 x i32] [[TMP34]], ptr [[TMP46]], align 4
326 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
327 // CHECK1-NEXT: store [3 x i32] [[TMP35]], ptr [[TMP47]], align 4
328 // CHECK1-NEXT: [[TMP48:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
329 // CHECK1-NEXT: store i32 0, ptr [[TMP48]], align 4
330 // CHECK1-NEXT: [[TMP49:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 [[TMP26]], i32 [[TMP29]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30.region_id, ptr [[KERNEL_ARGS]])
331 // CHECK1-NEXT: [[TMP50:%.*]] = icmp ne i32 [[TMP49]], 0
332 // CHECK1-NEXT: br i1 [[TMP50]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
333 // CHECK1: omp_offload.failed:
334 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30(i64 [[TMP2]], i64 [[TMP4]], ptr @a, i64 [[TMP6]], i64 [[TMP8]]) #[[ATTR3:[0-9]+]]
335 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
336 // CHECK1: omp_offload.cont:
337 // CHECK1-NEXT: [[TMP51:%.*]] = load i32, ptr [[N_ADDR]], align 4
338 // CHECK1-NEXT: store i32 [[TMP51]], ptr [[N_CASTED4]], align 4
339 // CHECK1-NEXT: [[TMP52:%.*]] = load i64, ptr [[N_CASTED4]], align 8
340 // CHECK1-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
341 // CHECK1-NEXT: store i64 [[TMP52]], ptr [[TMP53]], align 8
342 // CHECK1-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
343 // CHECK1-NEXT: store i64 [[TMP52]], ptr [[TMP54]], align 8
344 // CHECK1-NEXT: [[TMP55:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i64 0, i64 0
345 // CHECK1-NEXT: store ptr null, ptr [[TMP55]], align 8
346 // CHECK1-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 1
347 // CHECK1-NEXT: store ptr @a, ptr [[TMP56]], align 8
348 // CHECK1-NEXT: [[TMP57:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 1
349 // CHECK1-NEXT: store ptr @a, ptr [[TMP57]], align 8
350 // CHECK1-NEXT: [[TMP58:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i64 0, i64 1
351 // CHECK1-NEXT: store ptr null, ptr [[TMP58]], align 8
352 // CHECK1-NEXT: [[TMP59:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
353 // CHECK1-NEXT: [[TMP60:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
354 // CHECK1-NEXT: [[TMP61:%.*]] = load i32, ptr [[N_ADDR]], align 4
355 // CHECK1-NEXT: store i32 [[TMP61]], ptr [[DOTCAPTURE_EXPR_9]], align 4
356 // CHECK1-NEXT: [[TMP62:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_9]], align 4
357 // CHECK1-NEXT: [[SUB11:%.*]] = sub nsw i32 [[TMP62]], 0
358 // CHECK1-NEXT: [[DIV12:%.*]] = sdiv i32 [[SUB11]], 1
359 // CHECK1-NEXT: [[SUB13:%.*]] = sub nsw i32 [[DIV12]], 1
360 // CHECK1-NEXT: store i32 [[SUB13]], ptr [[DOTCAPTURE_EXPR_10]], align 4
361 // CHECK1-NEXT: [[TMP63:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_10]], align 4
362 // CHECK1-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP63]], 1
363 // CHECK1-NEXT: [[TMP64:%.*]] = zext i32 [[ADD14]] to i64
364 // CHECK1-NEXT: [[TMP65:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
365 // CHECK1-NEXT: store i32 3, ptr [[TMP65]], align 4
366 // CHECK1-NEXT: [[TMP66:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 1
367 // CHECK1-NEXT: store i32 2, ptr [[TMP66]], align 4
368 // CHECK1-NEXT: [[TMP67:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 2
369 // CHECK1-NEXT: store ptr [[TMP59]], ptr [[TMP67]], align 8
370 // CHECK1-NEXT: [[TMP68:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 3
371 // CHECK1-NEXT: store ptr [[TMP60]], ptr [[TMP68]], align 8
372 // CHECK1-NEXT: [[TMP69:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 4
373 // CHECK1-NEXT: store ptr @.offload_sizes.1, ptr [[TMP69]], align 8
374 // CHECK1-NEXT: [[TMP70:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 5
375 // CHECK1-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP70]], align 8
376 // CHECK1-NEXT: [[TMP71:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 6
377 // CHECK1-NEXT: store ptr null, ptr [[TMP71]], align 8
378 // CHECK1-NEXT: [[TMP72:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 7
379 // CHECK1-NEXT: store ptr null, ptr [[TMP72]], align 8
380 // CHECK1-NEXT: [[TMP73:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 8
381 // CHECK1-NEXT: store i64 [[TMP64]], ptr [[TMP73]], align 8
382 // CHECK1-NEXT: [[TMP74:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 9
383 // CHECK1-NEXT: store i64 0, ptr [[TMP74]], align 8
384 // CHECK1-NEXT: [[TMP75:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 10
385 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP75]], align 4
386 // CHECK1-NEXT: [[TMP76:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 11
387 // CHECK1-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP76]], align 4
388 // CHECK1-NEXT: [[TMP77:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 12
389 // CHECK1-NEXT: store i32 0, ptr [[TMP77]], align 4
390 // CHECK1-NEXT: [[TMP78:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36.region_id, ptr [[KERNEL_ARGS15]])
391 // CHECK1-NEXT: [[TMP79:%.*]] = icmp ne i32 [[TMP78]], 0
392 // CHECK1-NEXT: br i1 [[TMP79]], label [[OMP_OFFLOAD_FAILED16:%.*]], label [[OMP_OFFLOAD_CONT17:%.*]]
393 // CHECK1: omp_offload.failed16:
394 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36(i64 [[TMP52]], ptr @a) #[[ATTR3]]
395 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT17]]
396 // CHECK1: omp_offload.cont17:
397 // CHECK1-NEXT: [[TMP80:%.*]] = load i32, ptr @a, align 4
398 // CHECK1-NEXT: ret i32 [[TMP80]]
401 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30
402 // CHECK1-SAME: (i64 noundef [[TE:%.*]], i64 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]], i64 noundef [[I:%.*]], i64 noundef [[N:%.*]]) #[[ATTR1:[0-9]+]] {
403 // CHECK1-NEXT: entry:
404 // CHECK1-NEXT: [[TE_ADDR:%.*]] = alloca i64, align 8
405 // CHECK1-NEXT: [[TH_ADDR:%.*]] = alloca i64, align 8
406 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
407 // CHECK1-NEXT: [[I_ADDR:%.*]] = alloca i64, align 8
408 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
409 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
410 // CHECK1-NEXT: store i64 [[TE]], ptr [[TE_ADDR]], align 8
411 // CHECK1-NEXT: store i64 [[TH]], ptr [[TH_ADDR]], align 8
412 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
413 // CHECK1-NEXT: store i64 [[I]], ptr [[I_ADDR]], align 8
414 // CHECK1-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
415 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
416 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
417 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
418 // CHECK1-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
419 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30.omp_outlined, ptr [[I_ADDR]], ptr [[N_ADDR]], ptr [[TMP1]])
420 // CHECK1-NEXT: ret void
423 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30.omp_outlined
424 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[I:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
425 // CHECK1-NEXT: entry:
426 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
427 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
428 // CHECK1-NEXT: [[I_ADDR:%.*]] = alloca ptr, align 8
429 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
430 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
431 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
432 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
433 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
434 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
435 // CHECK1-NEXT: [[I3:%.*]] = alloca i32, align 4
436 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
437 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
438 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
439 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
440 // CHECK1-NEXT: [[I4:%.*]] = alloca i32, align 4
441 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
442 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
443 // CHECK1-NEXT: store ptr [[I]], ptr [[I_ADDR]], align 8
444 // CHECK1-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
445 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
446 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[I_ADDR]], align 8
447 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[N_ADDR]], align 8
448 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
449 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP1]], align 4
450 // CHECK1-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
451 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
452 // CHECK1-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
453 // CHECK1-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
454 // CHECK1-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
455 // CHECK1-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
456 // CHECK1-NEXT: store i32 0, ptr [[I3]], align 4
457 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
458 // CHECK1-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
459 // CHECK1-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
460 // CHECK1: omp.precond.then:
461 // CHECK1-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP2]], i64 0, i64 0
462 // CHECK1-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARRAYDECAY]], i64 16) ]
463 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
464 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
465 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
466 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
467 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
468 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
469 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
470 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
471 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
472 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
473 // CHECK1-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
474 // CHECK1-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
475 // CHECK1: cond.true:
476 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
477 // CHECK1-NEXT: br label [[COND_END:%.*]]
478 // CHECK1: cond.false:
479 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
480 // CHECK1-NEXT: br label [[COND_END]]
482 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
483 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
484 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
485 // CHECK1-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
486 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
487 // CHECK1: omp.inner.for.cond:
488 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
489 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
490 // CHECK1-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
491 // CHECK1-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
492 // CHECK1: omp.inner.for.body:
493 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
494 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
495 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
496 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP5]]
497 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP5]]
498 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
499 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP2]], i64 0, i64 [[IDXPROM]]
500 // CHECK1-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
501 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
502 // CHECK1: omp.body.continue:
503 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
504 // CHECK1: omp.inner.for.inc:
505 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
506 // CHECK1-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP18]], 1
507 // CHECK1-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
508 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
509 // CHECK1: omp.inner.for.end:
510 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
511 // CHECK1: omp.loop.exit:
512 // CHECK1-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
513 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
514 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
515 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
516 // CHECK1-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
517 // CHECK1-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
518 // CHECK1: .omp.final.then:
519 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
520 // CHECK1-NEXT: [[SUB8:%.*]] = sub nsw i32 [[TMP23]], 0
521 // CHECK1-NEXT: [[DIV9:%.*]] = sdiv i32 [[SUB8]], 1
522 // CHECK1-NEXT: [[MUL10:%.*]] = mul nsw i32 [[DIV9]], 1
523 // CHECK1-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
524 // CHECK1-NEXT: store i32 [[ADD11]], ptr [[TMP0]], align 4
525 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
526 // CHECK1: .omp.final.done:
527 // CHECK1-NEXT: br label [[OMP_PRECOND_END]]
528 // CHECK1: omp.precond.end:
529 // CHECK1-NEXT: ret void
532 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36
533 // CHECK1-SAME: (i64 noundef [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
534 // CHECK1-NEXT: entry:
535 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
536 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
537 // CHECK1-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
538 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
539 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
540 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36.omp_outlined, ptr [[N_ADDR]], ptr [[TMP0]])
541 // CHECK1-NEXT: ret void
544 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36.omp_outlined
545 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
546 // CHECK1-NEXT: entry:
547 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
548 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
549 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
550 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
551 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
552 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
553 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
554 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
555 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
556 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
557 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
558 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
559 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
560 // CHECK1-NEXT: [[I3:%.*]] = alloca i32, align 4
561 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
562 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
563 // CHECK1-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
564 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
565 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
566 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
567 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
568 // CHECK1-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
569 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
570 // CHECK1-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
571 // CHECK1-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
572 // CHECK1-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
573 // CHECK1-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
574 // CHECK1-NEXT: store i32 0, ptr [[I]], align 4
575 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
576 // CHECK1-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
577 // CHECK1-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
578 // CHECK1: omp.precond.then:
579 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
580 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
581 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
582 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
583 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
584 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
585 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP6]], align 4
586 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP7]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
587 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
588 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
589 // CHECK1-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP8]], [[TMP9]]
590 // CHECK1-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
591 // CHECK1: cond.true:
592 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
593 // CHECK1-NEXT: br label [[COND_END:%.*]]
594 // CHECK1: cond.false:
595 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
596 // CHECK1-NEXT: br label [[COND_END]]
598 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ [[TMP10]], [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
599 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
600 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
601 // CHECK1-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
602 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
603 // CHECK1: omp.inner.for.cond:
604 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
605 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
606 // CHECK1-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
607 // CHECK1-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
608 // CHECK1: omp.inner.for.body:
609 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
610 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP15]], 1
611 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
612 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
613 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[I3]], align 4
614 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP16]] to i64
615 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP1]], i64 0, i64 [[IDXPROM]]
616 // CHECK1-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
617 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
618 // CHECK1: omp.body.continue:
619 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
620 // CHECK1: omp.inner.for.inc:
621 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
622 // CHECK1-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP17]], 1
623 // CHECK1-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
624 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
625 // CHECK1: omp.inner.for.end:
626 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
627 // CHECK1: omp.loop.exit:
628 // CHECK1-NEXT: [[TMP18:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
629 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP18]], align 4
630 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP19]])
631 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
632 // CHECK1-NEXT: [[TMP21:%.*]] = icmp ne i32 [[TMP20]], 0
633 // CHECK1-NEXT: br i1 [[TMP21]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
634 // CHECK1: .omp.final.then:
635 // CHECK1-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
636 // CHECK1-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP22]], 0
637 // CHECK1-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
638 // CHECK1-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
639 // CHECK1-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
640 // CHECK1-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
641 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
642 // CHECK1: .omp.final.done:
643 // CHECK1-NEXT: br label [[OMP_PRECOND_END]]
644 // CHECK1: omp.precond.end:
645 // CHECK1-NEXT: ret void
648 // CHECK3-LABEL: define {{[^@]+}}@_Z21teams_argument_globali
649 // CHECK3-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0:[0-9]+]] {
650 // CHECK3-NEXT: entry:
651 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
652 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
653 // CHECK3-NEXT: [[TE:%.*]] = alloca i32, align 4
654 // CHECK3-NEXT: [[TH:%.*]] = alloca i32, align 4
655 // CHECK3-NEXT: [[TE_CASTED:%.*]] = alloca i32, align 4
656 // CHECK3-NEXT: [[TH_CASTED:%.*]] = alloca i32, align 4
657 // CHECK3-NEXT: [[I_CASTED:%.*]] = alloca i32, align 4
658 // CHECK3-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
659 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [5 x ptr], align 4
660 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [5 x ptr], align 4
661 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [5 x ptr], align 4
662 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
663 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
664 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
665 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
666 // CHECK3-NEXT: [[N_CASTED4:%.*]] = alloca i32, align 4
667 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS5:%.*]] = alloca [2 x ptr], align 4
668 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS6:%.*]] = alloca [2 x ptr], align 4
669 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS7:%.*]] = alloca [2 x ptr], align 4
670 // CHECK3-NEXT: [[_TMP8:%.*]] = alloca i32, align 4
671 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32, align 4
672 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_10:%.*]] = alloca i32, align 4
673 // CHECK3-NEXT: [[KERNEL_ARGS15:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
674 // CHECK3-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
675 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[N_ADDR]], align 4
676 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP0]], 128
677 // CHECK3-NEXT: store i32 [[DIV]], ptr [[TE]], align 4
678 // CHECK3-NEXT: store i32 128, ptr [[TH]], align 4
679 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE]], align 4
680 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[TE_CASTED]], align 4
681 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_CASTED]], align 4
682 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH]], align 4
683 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[TH_CASTED]], align 4
684 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[TH_CASTED]], align 4
685 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4
686 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[I_CASTED]], align 4
687 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[I_CASTED]], align 4
688 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[N_ADDR]], align 4
689 // CHECK3-NEXT: store i32 [[TMP7]], ptr [[N_CASTED]], align 4
690 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[N_CASTED]], align 4
691 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
692 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[TMP9]], align 4
693 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
694 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[TMP10]], align 4
695 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
696 // CHECK3-NEXT: store ptr null, ptr [[TMP11]], align 4
697 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
698 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[TMP12]], align 4
699 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
700 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[TMP13]], align 4
701 // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
702 // CHECK3-NEXT: store ptr null, ptr [[TMP14]], align 4
703 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
704 // CHECK3-NEXT: store ptr @a, ptr [[TMP15]], align 4
705 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
706 // CHECK3-NEXT: store ptr @a, ptr [[TMP16]], align 4
707 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
708 // CHECK3-NEXT: store ptr null, ptr [[TMP17]], align 4
709 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
710 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[TMP18]], align 4
711 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
712 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[TMP19]], align 4
713 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 3
714 // CHECK3-NEXT: store ptr null, ptr [[TMP20]], align 4
715 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 4
716 // CHECK3-NEXT: store i32 [[TMP8]], ptr [[TMP21]], align 4
717 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 4
718 // CHECK3-NEXT: store i32 [[TMP8]], ptr [[TMP22]], align 4
719 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 4
720 // CHECK3-NEXT: store ptr null, ptr [[TMP23]], align 4
721 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
722 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
723 // CHECK3-NEXT: [[TMP26:%.*]] = load i32, ptr [[TE]], align 4
724 // CHECK3-NEXT: [[TMP27:%.*]] = load i32, ptr [[TH]], align 4
725 // CHECK3-NEXT: [[TMP28:%.*]] = icmp ult i32 [[TMP27]], 1
726 // CHECK3-NEXT: [[TMP29:%.*]] = select i1 [[TMP28]], i32 [[TMP27]], i32 1
727 // CHECK3-NEXT: [[TMP30:%.*]] = load i32, ptr [[N_ADDR]], align 4
728 // CHECK3-NEXT: store i32 [[TMP30]], ptr [[DOTCAPTURE_EXPR_]], align 4
729 // CHECK3-NEXT: [[TMP31:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
730 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP31]], 0
731 // CHECK3-NEXT: [[DIV2:%.*]] = sdiv i32 [[SUB]], 1
732 // CHECK3-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV2]], 1
733 // CHECK3-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
734 // CHECK3-NEXT: [[TMP32:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
735 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP32]], 1
736 // CHECK3-NEXT: [[TMP33:%.*]] = zext i32 [[ADD]] to i64
737 // CHECK3-NEXT: [[TMP34:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP26]], 0
738 // CHECK3-NEXT: [[TMP35:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP29]], 0
739 // CHECK3-NEXT: [[TMP36:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
740 // CHECK3-NEXT: store i32 3, ptr [[TMP36]], align 4
741 // CHECK3-NEXT: [[TMP37:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
742 // CHECK3-NEXT: store i32 5, ptr [[TMP37]], align 4
743 // CHECK3-NEXT: [[TMP38:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
744 // CHECK3-NEXT: store ptr [[TMP24]], ptr [[TMP38]], align 4
745 // CHECK3-NEXT: [[TMP39:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
746 // CHECK3-NEXT: store ptr [[TMP25]], ptr [[TMP39]], align 4
747 // CHECK3-NEXT: [[TMP40:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
748 // CHECK3-NEXT: store ptr @.offload_sizes, ptr [[TMP40]], align 4
749 // CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
750 // CHECK3-NEXT: store ptr @.offload_maptypes, ptr [[TMP41]], align 4
751 // CHECK3-NEXT: [[TMP42:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
752 // CHECK3-NEXT: store ptr null, ptr [[TMP42]], align 4
753 // CHECK3-NEXT: [[TMP43:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
754 // CHECK3-NEXT: store ptr null, ptr [[TMP43]], align 4
755 // CHECK3-NEXT: [[TMP44:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
756 // CHECK3-NEXT: store i64 [[TMP33]], ptr [[TMP44]], align 8
757 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
758 // CHECK3-NEXT: store i64 0, ptr [[TMP45]], align 8
759 // CHECK3-NEXT: [[TMP46:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
760 // CHECK3-NEXT: store [3 x i32] [[TMP34]], ptr [[TMP46]], align 4
761 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
762 // CHECK3-NEXT: store [3 x i32] [[TMP35]], ptr [[TMP47]], align 4
763 // CHECK3-NEXT: [[TMP48:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
764 // CHECK3-NEXT: store i32 0, ptr [[TMP48]], align 4
765 // CHECK3-NEXT: [[TMP49:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 [[TMP26]], i32 [[TMP29]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30.region_id, ptr [[KERNEL_ARGS]])
766 // CHECK3-NEXT: [[TMP50:%.*]] = icmp ne i32 [[TMP49]], 0
767 // CHECK3-NEXT: br i1 [[TMP50]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
768 // CHECK3: omp_offload.failed:
769 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30(i32 [[TMP2]], i32 [[TMP4]], ptr @a, i32 [[TMP6]], i32 [[TMP8]]) #[[ATTR3:[0-9]+]]
770 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
771 // CHECK3: omp_offload.cont:
772 // CHECK3-NEXT: [[TMP51:%.*]] = load i32, ptr [[N_ADDR]], align 4
773 // CHECK3-NEXT: store i32 [[TMP51]], ptr [[N_CASTED4]], align 4
774 // CHECK3-NEXT: [[TMP52:%.*]] = load i32, ptr [[N_CASTED4]], align 4
775 // CHECK3-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
776 // CHECK3-NEXT: store i32 [[TMP52]], ptr [[TMP53]], align 4
777 // CHECK3-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
778 // CHECK3-NEXT: store i32 [[TMP52]], ptr [[TMP54]], align 4
779 // CHECK3-NEXT: [[TMP55:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i32 0, i32 0
780 // CHECK3-NEXT: store ptr null, ptr [[TMP55]], align 4
781 // CHECK3-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 1
782 // CHECK3-NEXT: store ptr @a, ptr [[TMP56]], align 4
783 // CHECK3-NEXT: [[TMP57:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 1
784 // CHECK3-NEXT: store ptr @a, ptr [[TMP57]], align 4
785 // CHECK3-NEXT: [[TMP58:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i32 0, i32 1
786 // CHECK3-NEXT: store ptr null, ptr [[TMP58]], align 4
787 // CHECK3-NEXT: [[TMP59:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
788 // CHECK3-NEXT: [[TMP60:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
789 // CHECK3-NEXT: [[TMP61:%.*]] = load i32, ptr [[N_ADDR]], align 4
790 // CHECK3-NEXT: store i32 [[TMP61]], ptr [[DOTCAPTURE_EXPR_9]], align 4
791 // CHECK3-NEXT: [[TMP62:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_9]], align 4
792 // CHECK3-NEXT: [[SUB11:%.*]] = sub nsw i32 [[TMP62]], 0
793 // CHECK3-NEXT: [[DIV12:%.*]] = sdiv i32 [[SUB11]], 1
794 // CHECK3-NEXT: [[SUB13:%.*]] = sub nsw i32 [[DIV12]], 1
795 // CHECK3-NEXT: store i32 [[SUB13]], ptr [[DOTCAPTURE_EXPR_10]], align 4
796 // CHECK3-NEXT: [[TMP63:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_10]], align 4
797 // CHECK3-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP63]], 1
798 // CHECK3-NEXT: [[TMP64:%.*]] = zext i32 [[ADD14]] to i64
799 // CHECK3-NEXT: [[TMP65:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
800 // CHECK3-NEXT: store i32 3, ptr [[TMP65]], align 4
801 // CHECK3-NEXT: [[TMP66:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 1
802 // CHECK3-NEXT: store i32 2, ptr [[TMP66]], align 4
803 // CHECK3-NEXT: [[TMP67:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 2
804 // CHECK3-NEXT: store ptr [[TMP59]], ptr [[TMP67]], align 4
805 // CHECK3-NEXT: [[TMP68:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 3
806 // CHECK3-NEXT: store ptr [[TMP60]], ptr [[TMP68]], align 4
807 // CHECK3-NEXT: [[TMP69:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 4
808 // CHECK3-NEXT: store ptr @.offload_sizes.1, ptr [[TMP69]], align 4
809 // CHECK3-NEXT: [[TMP70:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 5
810 // CHECK3-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP70]], align 4
811 // CHECK3-NEXT: [[TMP71:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 6
812 // CHECK3-NEXT: store ptr null, ptr [[TMP71]], align 4
813 // CHECK3-NEXT: [[TMP72:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 7
814 // CHECK3-NEXT: store ptr null, ptr [[TMP72]], align 4
815 // CHECK3-NEXT: [[TMP73:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 8
816 // CHECK3-NEXT: store i64 [[TMP64]], ptr [[TMP73]], align 8
817 // CHECK3-NEXT: [[TMP74:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 9
818 // CHECK3-NEXT: store i64 0, ptr [[TMP74]], align 8
819 // CHECK3-NEXT: [[TMP75:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 10
820 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP75]], align 4
821 // CHECK3-NEXT: [[TMP76:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 11
822 // CHECK3-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP76]], align 4
823 // CHECK3-NEXT: [[TMP77:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 12
824 // CHECK3-NEXT: store i32 0, ptr [[TMP77]], align 4
825 // CHECK3-NEXT: [[TMP78:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36.region_id, ptr [[KERNEL_ARGS15]])
826 // CHECK3-NEXT: [[TMP79:%.*]] = icmp ne i32 [[TMP78]], 0
827 // CHECK3-NEXT: br i1 [[TMP79]], label [[OMP_OFFLOAD_FAILED16:%.*]], label [[OMP_OFFLOAD_CONT17:%.*]]
828 // CHECK3: omp_offload.failed16:
829 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36(i32 [[TMP52]], ptr @a) #[[ATTR3]]
830 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT17]]
831 // CHECK3: omp_offload.cont17:
832 // CHECK3-NEXT: [[TMP80:%.*]] = load i32, ptr @a, align 4
833 // CHECK3-NEXT: ret i32 [[TMP80]]
836 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30
837 // CHECK3-SAME: (i32 noundef [[TE:%.*]], i32 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]], i32 noundef [[I:%.*]], i32 noundef [[N:%.*]]) #[[ATTR1:[0-9]+]] {
838 // CHECK3-NEXT: entry:
839 // CHECK3-NEXT: [[TE_ADDR:%.*]] = alloca i32, align 4
840 // CHECK3-NEXT: [[TH_ADDR:%.*]] = alloca i32, align 4
841 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
842 // CHECK3-NEXT: [[I_ADDR:%.*]] = alloca i32, align 4
843 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
844 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
845 // CHECK3-NEXT: store i32 [[TE]], ptr [[TE_ADDR]], align 4
846 // CHECK3-NEXT: store i32 [[TH]], ptr [[TH_ADDR]], align 4
847 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
848 // CHECK3-NEXT: store i32 [[I]], ptr [[I_ADDR]], align 4
849 // CHECK3-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
850 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
851 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
852 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
853 // CHECK3-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
854 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30.omp_outlined, ptr [[I_ADDR]], ptr [[N_ADDR]], ptr [[TMP1]])
855 // CHECK3-NEXT: ret void
858 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30.omp_outlined
859 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[I:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
860 // CHECK3-NEXT: entry:
861 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
862 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
863 // CHECK3-NEXT: [[I_ADDR:%.*]] = alloca ptr, align 4
864 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
865 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
866 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
867 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
868 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
869 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
870 // CHECK3-NEXT: [[I3:%.*]] = alloca i32, align 4
871 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
872 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
873 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
874 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
875 // CHECK3-NEXT: [[I4:%.*]] = alloca i32, align 4
876 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
877 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
878 // CHECK3-NEXT: store ptr [[I]], ptr [[I_ADDR]], align 4
879 // CHECK3-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
880 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
881 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[I_ADDR]], align 4
882 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[N_ADDR]], align 4
883 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
884 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP1]], align 4
885 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
886 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
887 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
888 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
889 // CHECK3-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
890 // CHECK3-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
891 // CHECK3-NEXT: store i32 0, ptr [[I3]], align 4
892 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
893 // CHECK3-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
894 // CHECK3-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
895 // CHECK3: omp.precond.then:
896 // CHECK3-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP2]], i32 0, i32 0
897 // CHECK3-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARRAYDECAY]], i32 16) ]
898 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
899 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
900 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
901 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
902 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
903 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
904 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
905 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
906 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
907 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
908 // CHECK3-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
909 // CHECK3-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
910 // CHECK3: cond.true:
911 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
912 // CHECK3-NEXT: br label [[COND_END:%.*]]
913 // CHECK3: cond.false:
914 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
915 // CHECK3-NEXT: br label [[COND_END]]
917 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
918 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
919 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
920 // CHECK3-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
921 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
922 // CHECK3: omp.inner.for.cond:
923 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
924 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP6]]
925 // CHECK3-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
926 // CHECK3-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
927 // CHECK3: omp.inner.for.body:
928 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
929 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
930 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
931 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP6]]
932 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP6]]
933 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP2]], i32 0, i32 [[TMP17]]
934 // CHECK3-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP6]]
935 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
936 // CHECK3: omp.body.continue:
937 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
938 // CHECK3: omp.inner.for.inc:
939 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
940 // CHECK3-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP18]], 1
941 // CHECK3-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
942 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
943 // CHECK3: omp.inner.for.end:
944 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
945 // CHECK3: omp.loop.exit:
946 // CHECK3-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
947 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
948 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
949 // CHECK3-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
950 // CHECK3-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
951 // CHECK3-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
952 // CHECK3: .omp.final.then:
953 // CHECK3-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
954 // CHECK3-NEXT: [[SUB8:%.*]] = sub nsw i32 [[TMP23]], 0
955 // CHECK3-NEXT: [[DIV9:%.*]] = sdiv i32 [[SUB8]], 1
956 // CHECK3-NEXT: [[MUL10:%.*]] = mul nsw i32 [[DIV9]], 1
957 // CHECK3-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
958 // CHECK3-NEXT: store i32 [[ADD11]], ptr [[TMP0]], align 4
959 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
960 // CHECK3: .omp.final.done:
961 // CHECK3-NEXT: br label [[OMP_PRECOND_END]]
962 // CHECK3: omp.precond.end:
963 // CHECK3-NEXT: ret void
966 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36
967 // CHECK3-SAME: (i32 noundef [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
968 // CHECK3-NEXT: entry:
969 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
970 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
971 // CHECK3-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
972 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
973 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
974 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36.omp_outlined, ptr [[N_ADDR]], ptr [[TMP0]])
975 // CHECK3-NEXT: ret void
978 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36.omp_outlined
979 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
980 // CHECK3-NEXT: entry:
981 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
982 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
983 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
984 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
985 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
986 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
987 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
988 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
989 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
990 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
991 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
992 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
993 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
994 // CHECK3-NEXT: [[I3:%.*]] = alloca i32, align 4
995 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
996 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
997 // CHECK3-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
998 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
999 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
1000 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1001 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
1002 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
1003 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1004 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
1005 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1006 // CHECK3-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1007 // CHECK3-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1008 // CHECK3-NEXT: store i32 0, ptr [[I]], align 4
1009 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1010 // CHECK3-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
1011 // CHECK3-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1012 // CHECK3: omp.precond.then:
1013 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1014 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1015 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
1016 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1017 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1018 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1019 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP6]], align 4
1020 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP7]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1021 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1022 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1023 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP8]], [[TMP9]]
1024 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1025 // CHECK3: cond.true:
1026 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1027 // CHECK3-NEXT: br label [[COND_END:%.*]]
1028 // CHECK3: cond.false:
1029 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1030 // CHECK3-NEXT: br label [[COND_END]]
1031 // CHECK3: cond.end:
1032 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ [[TMP10]], [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
1033 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1034 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1035 // CHECK3-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
1036 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1037 // CHECK3: omp.inner.for.cond:
1038 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1039 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1040 // CHECK3-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
1041 // CHECK3-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1042 // CHECK3: omp.inner.for.body:
1043 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1044 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP15]], 1
1045 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1046 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
1047 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[I3]], align 4
1048 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP1]], i32 0, i32 [[TMP16]]
1049 // CHECK3-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1050 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1051 // CHECK3: omp.body.continue:
1052 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1053 // CHECK3: omp.inner.for.inc:
1054 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1055 // CHECK3-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP17]], 1
1056 // CHECK3-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
1057 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP13:![0-9]+]]
1058 // CHECK3: omp.inner.for.end:
1059 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1060 // CHECK3: omp.loop.exit:
1061 // CHECK3-NEXT: [[TMP18:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1062 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP18]], align 4
1063 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP19]])
1064 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1065 // CHECK3-NEXT: [[TMP21:%.*]] = icmp ne i32 [[TMP20]], 0
1066 // CHECK3-NEXT: br i1 [[TMP21]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1067 // CHECK3: .omp.final.then:
1068 // CHECK3-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1069 // CHECK3-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP22]], 0
1070 // CHECK3-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
1071 // CHECK3-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
1072 // CHECK3-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
1073 // CHECK3-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
1074 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
1075 // CHECK3: .omp.final.done:
1076 // CHECK3-NEXT: br label [[OMP_PRECOND_END]]
1077 // CHECK3: omp.precond.end:
1078 // CHECK3-NEXT: ret void
1081 // CHECK5-LABEL: define {{[^@]+}}@_Z21teams_argument_globali
1082 // CHECK5-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
1083 // CHECK5-NEXT: entry:
1084 // CHECK5-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
1085 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
1086 // CHECK5-NEXT: [[TE:%.*]] = alloca i32, align 4
1087 // CHECK5-NEXT: [[TH:%.*]] = alloca i32, align 4
1088 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
1089 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1090 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1091 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1092 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1093 // CHECK5-NEXT: [[I4:%.*]] = alloca i32, align 4
1094 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1095 // CHECK5-NEXT: [[DOTLINEAR_START:%.*]] = alloca i32, align 4
1096 // CHECK5-NEXT: [[I5:%.*]] = alloca i32, align 4
1097 // CHECK5-NEXT: [[I6:%.*]] = alloca i32, align 4
1098 // CHECK5-NEXT: [[_TMP13:%.*]] = alloca i32, align 4
1099 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_14:%.*]] = alloca i32, align 4
1100 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_15:%.*]] = alloca i32, align 4
1101 // CHECK5-NEXT: [[DOTOMP_LB19:%.*]] = alloca i32, align 4
1102 // CHECK5-NEXT: [[DOTOMP_UB20:%.*]] = alloca i32, align 4
1103 // CHECK5-NEXT: [[I21:%.*]] = alloca i32, align 4
1104 // CHECK5-NEXT: [[DOTOMP_IV24:%.*]] = alloca i32, align 4
1105 // CHECK5-NEXT: [[I25:%.*]] = alloca i32, align 4
1106 // CHECK5-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
1107 // CHECK5-NEXT: [[TMP0:%.*]] = load i32, ptr [[N_ADDR]], align 4
1108 // CHECK5-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP0]], 128
1109 // CHECK5-NEXT: store i32 [[DIV]], ptr [[TE]], align 4
1110 // CHECK5-NEXT: store i32 128, ptr [[TH]], align 4
1111 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[N_ADDR]], align 4
1112 // CHECK5-NEXT: store i32 [[TMP1]], ptr [[DOTCAPTURE_EXPR_]], align 4
1113 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1114 // CHECK5-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP2]], 0
1115 // CHECK5-NEXT: [[DIV2:%.*]] = sdiv i32 [[SUB]], 1
1116 // CHECK5-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV2]], 1
1117 // CHECK5-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1118 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1119 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1120 // CHECK5-NEXT: store i32 [[TMP3]], ptr [[DOTOMP_UB]], align 4
1121 // CHECK5-NEXT: store i32 0, ptr [[I4]], align 4
1122 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1123 // CHECK5-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
1124 // CHECK5-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
1125 // CHECK5: simd.if.then:
1126 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1127 // CHECK5-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
1128 // CHECK5-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr @a, i64 16) ]
1129 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[I]], align 4
1130 // CHECK5-NEXT: store i32 [[TMP6]], ptr [[DOTLINEAR_START]], align 4
1131 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1132 // CHECK5: omp.inner.for.cond:
1133 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
1134 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
1135 // CHECK5-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1136 // CHECK5-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1137 // CHECK5: omp.inner.for.body:
1138 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1139 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1140 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1141 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I5]], align 4, !llvm.access.group [[ACC_GRP2]]
1142 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[I5]], align 4, !llvm.access.group [[ACC_GRP2]]
1143 // CHECK5-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP10]] to i64
1144 // CHECK5-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr @a, i64 0, i64 [[IDXPROM]]
1145 // CHECK5-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
1146 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1147 // CHECK5: omp.body.continue:
1148 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1149 // CHECK5: omp.inner.for.inc:
1150 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1151 // CHECK5-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP11]], 1
1152 // CHECK5-NEXT: store i32 [[ADD8]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1153 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
1154 // CHECK5: omp.inner.for.end:
1155 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1156 // CHECK5-NEXT: [[SUB9:%.*]] = sub nsw i32 [[TMP12]], 0
1157 // CHECK5-NEXT: [[DIV10:%.*]] = sdiv i32 [[SUB9]], 1
1158 // CHECK5-NEXT: [[MUL11:%.*]] = mul nsw i32 [[DIV10]], 1
1159 // CHECK5-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
1160 // CHECK5-NEXT: store i32 [[ADD12]], ptr [[I]], align 4
1161 // CHECK5-NEXT: br label [[SIMD_IF_END]]
1162 // CHECK5: simd.if.end:
1163 // CHECK5-NEXT: [[TMP13:%.*]] = load i32, ptr [[N_ADDR]], align 4
1164 // CHECK5-NEXT: store i32 [[TMP13]], ptr [[DOTCAPTURE_EXPR_14]], align 4
1165 // CHECK5-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1166 // CHECK5-NEXT: [[SUB16:%.*]] = sub nsw i32 [[TMP14]], 0
1167 // CHECK5-NEXT: [[DIV17:%.*]] = sdiv i32 [[SUB16]], 1
1168 // CHECK5-NEXT: [[SUB18:%.*]] = sub nsw i32 [[DIV17]], 1
1169 // CHECK5-NEXT: store i32 [[SUB18]], ptr [[DOTCAPTURE_EXPR_15]], align 4
1170 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB19]], align 4
1171 // CHECK5-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_15]], align 4
1172 // CHECK5-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_UB20]], align 4
1173 // CHECK5-NEXT: store i32 0, ptr [[I21]], align 4
1174 // CHECK5-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1175 // CHECK5-NEXT: [[CMP22:%.*]] = icmp slt i32 0, [[TMP16]]
1176 // CHECK5-NEXT: br i1 [[CMP22]], label [[SIMD_IF_THEN23:%.*]], label [[SIMD_IF_END41:%.*]]
1177 // CHECK5: simd.if.then23:
1178 // CHECK5-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_LB19]], align 4
1179 // CHECK5-NEXT: store i32 [[TMP17]], ptr [[DOTOMP_IV24]], align 4
1180 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND26:%.*]]
1181 // CHECK5: omp.inner.for.cond26:
1182 // CHECK5-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1183 // CHECK5-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_UB20]], align 4
1184 // CHECK5-NEXT: [[CMP27:%.*]] = icmp sle i32 [[TMP18]], [[TMP19]]
1185 // CHECK5-NEXT: br i1 [[CMP27]], label [[OMP_INNER_FOR_BODY28:%.*]], label [[OMP_INNER_FOR_END36:%.*]]
1186 // CHECK5: omp.inner.for.body28:
1187 // CHECK5-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1188 // CHECK5-NEXT: [[MUL29:%.*]] = mul nsw i32 [[TMP20]], 1
1189 // CHECK5-NEXT: [[ADD30:%.*]] = add nsw i32 0, [[MUL29]]
1190 // CHECK5-NEXT: store i32 [[ADD30]], ptr [[I25]], align 4
1191 // CHECK5-NEXT: [[TMP21:%.*]] = load i32, ptr [[I25]], align 4
1192 // CHECK5-NEXT: [[IDXPROM31:%.*]] = sext i32 [[TMP21]] to i64
1193 // CHECK5-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [100 x i32], ptr @a, i64 0, i64 [[IDXPROM31]]
1194 // CHECK5-NEXT: store i32 0, ptr [[ARRAYIDX32]], align 4
1195 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE33:%.*]]
1196 // CHECK5: omp.body.continue33:
1197 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC34:%.*]]
1198 // CHECK5: omp.inner.for.inc34:
1199 // CHECK5-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1200 // CHECK5-NEXT: [[ADD35:%.*]] = add nsw i32 [[TMP22]], 1
1201 // CHECK5-NEXT: store i32 [[ADD35]], ptr [[DOTOMP_IV24]], align 4
1202 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND26]], !llvm.loop [[LOOP7:![0-9]+]]
1203 // CHECK5: omp.inner.for.end36:
1204 // CHECK5-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1205 // CHECK5-NEXT: [[SUB37:%.*]] = sub nsw i32 [[TMP23]], 0
1206 // CHECK5-NEXT: [[DIV38:%.*]] = sdiv i32 [[SUB37]], 1
1207 // CHECK5-NEXT: [[MUL39:%.*]] = mul nsw i32 [[DIV38]], 1
1208 // CHECK5-NEXT: [[ADD40:%.*]] = add nsw i32 0, [[MUL39]]
1209 // CHECK5-NEXT: store i32 [[ADD40]], ptr [[I25]], align 4
1210 // CHECK5-NEXT: br label [[SIMD_IF_END41]]
1211 // CHECK5: simd.if.end41:
1212 // CHECK5-NEXT: [[TMP24:%.*]] = load i32, ptr @a, align 4
1213 // CHECK5-NEXT: ret i32 [[TMP24]]
1216 // CHECK7-LABEL: define {{[^@]+}}@_Z21teams_argument_globali
1217 // CHECK7-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0:[0-9]+]] {
1218 // CHECK7-NEXT: entry:
1219 // CHECK7-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
1220 // CHECK7-NEXT: [[I:%.*]] = alloca i32, align 4
1221 // CHECK7-NEXT: [[TE:%.*]] = alloca i32, align 4
1222 // CHECK7-NEXT: [[TH:%.*]] = alloca i32, align 4
1223 // CHECK7-NEXT: [[TMP:%.*]] = alloca i32, align 4
1224 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1225 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1226 // CHECK7-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1227 // CHECK7-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1228 // CHECK7-NEXT: [[I4:%.*]] = alloca i32, align 4
1229 // CHECK7-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1230 // CHECK7-NEXT: [[DOTLINEAR_START:%.*]] = alloca i32, align 4
1231 // CHECK7-NEXT: [[I5:%.*]] = alloca i32, align 4
1232 // CHECK7-NEXT: [[I6:%.*]] = alloca i32, align 4
1233 // CHECK7-NEXT: [[_TMP13:%.*]] = alloca i32, align 4
1234 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_14:%.*]] = alloca i32, align 4
1235 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_15:%.*]] = alloca i32, align 4
1236 // CHECK7-NEXT: [[DOTOMP_LB19:%.*]] = alloca i32, align 4
1237 // CHECK7-NEXT: [[DOTOMP_UB20:%.*]] = alloca i32, align 4
1238 // CHECK7-NEXT: [[I21:%.*]] = alloca i32, align 4
1239 // CHECK7-NEXT: [[DOTOMP_IV24:%.*]] = alloca i32, align 4
1240 // CHECK7-NEXT: [[I25:%.*]] = alloca i32, align 4
1241 // CHECK7-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
1242 // CHECK7-NEXT: [[TMP0:%.*]] = load i32, ptr [[N_ADDR]], align 4
1243 // CHECK7-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP0]], 128
1244 // CHECK7-NEXT: store i32 [[DIV]], ptr [[TE]], align 4
1245 // CHECK7-NEXT: store i32 128, ptr [[TH]], align 4
1246 // CHECK7-NEXT: [[TMP1:%.*]] = load i32, ptr [[N_ADDR]], align 4
1247 // CHECK7-NEXT: store i32 [[TMP1]], ptr [[DOTCAPTURE_EXPR_]], align 4
1248 // CHECK7-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1249 // CHECK7-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP2]], 0
1250 // CHECK7-NEXT: [[DIV2:%.*]] = sdiv i32 [[SUB]], 1
1251 // CHECK7-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV2]], 1
1252 // CHECK7-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1253 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1254 // CHECK7-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1255 // CHECK7-NEXT: store i32 [[TMP3]], ptr [[DOTOMP_UB]], align 4
1256 // CHECK7-NEXT: store i32 0, ptr [[I4]], align 4
1257 // CHECK7-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1258 // CHECK7-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
1259 // CHECK7-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
1260 // CHECK7: simd.if.then:
1261 // CHECK7-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1262 // CHECK7-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
1263 // CHECK7-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr @a, i32 16) ]
1264 // CHECK7-NEXT: [[TMP6:%.*]] = load i32, ptr [[I]], align 4
1265 // CHECK7-NEXT: store i32 [[TMP6]], ptr [[DOTLINEAR_START]], align 4
1266 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1267 // CHECK7: omp.inner.for.cond:
1268 // CHECK7-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
1269 // CHECK7-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
1270 // CHECK7-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1271 // CHECK7-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1272 // CHECK7: omp.inner.for.body:
1273 // CHECK7-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1274 // CHECK7-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1275 // CHECK7-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1276 // CHECK7-NEXT: store i32 [[ADD]], ptr [[I5]], align 4, !llvm.access.group [[ACC_GRP3]]
1277 // CHECK7-NEXT: [[TMP10:%.*]] = load i32, ptr [[I5]], align 4, !llvm.access.group [[ACC_GRP3]]
1278 // CHECK7-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr @a, i32 0, i32 [[TMP10]]
1279 // CHECK7-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
1280 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1281 // CHECK7: omp.body.continue:
1282 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1283 // CHECK7: omp.inner.for.inc:
1284 // CHECK7-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1285 // CHECK7-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP11]], 1
1286 // CHECK7-NEXT: store i32 [[ADD8]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1287 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
1288 // CHECK7: omp.inner.for.end:
1289 // CHECK7-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1290 // CHECK7-NEXT: [[SUB9:%.*]] = sub nsw i32 [[TMP12]], 0
1291 // CHECK7-NEXT: [[DIV10:%.*]] = sdiv i32 [[SUB9]], 1
1292 // CHECK7-NEXT: [[MUL11:%.*]] = mul nsw i32 [[DIV10]], 1
1293 // CHECK7-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
1294 // CHECK7-NEXT: store i32 [[ADD12]], ptr [[I]], align 4
1295 // CHECK7-NEXT: br label [[SIMD_IF_END]]
1296 // CHECK7: simd.if.end:
1297 // CHECK7-NEXT: [[TMP13:%.*]] = load i32, ptr [[N_ADDR]], align 4
1298 // CHECK7-NEXT: store i32 [[TMP13]], ptr [[DOTCAPTURE_EXPR_14]], align 4
1299 // CHECK7-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1300 // CHECK7-NEXT: [[SUB16:%.*]] = sub nsw i32 [[TMP14]], 0
1301 // CHECK7-NEXT: [[DIV17:%.*]] = sdiv i32 [[SUB16]], 1
1302 // CHECK7-NEXT: [[SUB18:%.*]] = sub nsw i32 [[DIV17]], 1
1303 // CHECK7-NEXT: store i32 [[SUB18]], ptr [[DOTCAPTURE_EXPR_15]], align 4
1304 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB19]], align 4
1305 // CHECK7-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_15]], align 4
1306 // CHECK7-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_UB20]], align 4
1307 // CHECK7-NEXT: store i32 0, ptr [[I21]], align 4
1308 // CHECK7-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1309 // CHECK7-NEXT: [[CMP22:%.*]] = icmp slt i32 0, [[TMP16]]
1310 // CHECK7-NEXT: br i1 [[CMP22]], label [[SIMD_IF_THEN23:%.*]], label [[SIMD_IF_END40:%.*]]
1311 // CHECK7: simd.if.then23:
1312 // CHECK7-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_LB19]], align 4
1313 // CHECK7-NEXT: store i32 [[TMP17]], ptr [[DOTOMP_IV24]], align 4
1314 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND26:%.*]]
1315 // CHECK7: omp.inner.for.cond26:
1316 // CHECK7-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1317 // CHECK7-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_UB20]], align 4
1318 // CHECK7-NEXT: [[CMP27:%.*]] = icmp sle i32 [[TMP18]], [[TMP19]]
1319 // CHECK7-NEXT: br i1 [[CMP27]], label [[OMP_INNER_FOR_BODY28:%.*]], label [[OMP_INNER_FOR_END35:%.*]]
1320 // CHECK7: omp.inner.for.body28:
1321 // CHECK7-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1322 // CHECK7-NEXT: [[MUL29:%.*]] = mul nsw i32 [[TMP20]], 1
1323 // CHECK7-NEXT: [[ADD30:%.*]] = add nsw i32 0, [[MUL29]]
1324 // CHECK7-NEXT: store i32 [[ADD30]], ptr [[I25]], align 4
1325 // CHECK7-NEXT: [[TMP21:%.*]] = load i32, ptr [[I25]], align 4
1326 // CHECK7-NEXT: [[ARRAYIDX31:%.*]] = getelementptr inbounds [100 x i32], ptr @a, i32 0, i32 [[TMP21]]
1327 // CHECK7-NEXT: store i32 0, ptr [[ARRAYIDX31]], align 4
1328 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE32:%.*]]
1329 // CHECK7: omp.body.continue32:
1330 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC33:%.*]]
1331 // CHECK7: omp.inner.for.inc33:
1332 // CHECK7-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1333 // CHECK7-NEXT: [[ADD34:%.*]] = add nsw i32 [[TMP22]], 1
1334 // CHECK7-NEXT: store i32 [[ADD34]], ptr [[DOTOMP_IV24]], align 4
1335 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND26]], !llvm.loop [[LOOP8:![0-9]+]]
1336 // CHECK7: omp.inner.for.end35:
1337 // CHECK7-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1338 // CHECK7-NEXT: [[SUB36:%.*]] = sub nsw i32 [[TMP23]], 0
1339 // CHECK7-NEXT: [[DIV37:%.*]] = sdiv i32 [[SUB36]], 1
1340 // CHECK7-NEXT: [[MUL38:%.*]] = mul nsw i32 [[DIV37]], 1
1341 // CHECK7-NEXT: [[ADD39:%.*]] = add nsw i32 0, [[MUL38]]
1342 // CHECK7-NEXT: store i32 [[ADD39]], ptr [[I25]], align 4
1343 // CHECK7-NEXT: br label [[SIMD_IF_END40]]
1344 // CHECK7: simd.if.end40:
1345 // CHECK7-NEXT: [[TMP24:%.*]] = load i32, ptr @a, align 4
1346 // CHECK7-NEXT: ret i32 [[TMP24]]
1349 // CHECK9-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1350 // CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
1351 // CHECK9-NEXT: entry:
1352 // CHECK9-NEXT: [[N:%.*]] = alloca i32, align 4
1353 // CHECK9-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
1354 // CHECK9-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
1355 // CHECK9-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
1356 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
1357 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
1358 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
1359 // CHECK9-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
1360 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1361 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1362 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1363 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1364 // CHECK9-NEXT: store i32 100, ptr [[N]], align 4
1365 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1366 // CHECK9-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
1367 // CHECK9-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
1368 // CHECK9-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
1369 // CHECK9-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
1370 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
1371 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
1372 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[N_CASTED]], align 4
1373 // CHECK9-NEXT: [[TMP4:%.*]] = load i64, ptr [[N_CASTED]], align 8
1374 // CHECK9-NEXT: [[TMP5:%.*]] = mul nuw i64 [[TMP1]], 4
1375 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
1376 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1377 // CHECK9-NEXT: store i64 [[TMP4]], ptr [[TMP6]], align 8
1378 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1379 // CHECK9-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
1380 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
1381 // CHECK9-NEXT: store ptr null, ptr [[TMP8]], align 8
1382 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1383 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP9]], align 8
1384 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1385 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP10]], align 8
1386 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
1387 // CHECK9-NEXT: store ptr null, ptr [[TMP11]], align 8
1388 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1389 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 8
1390 // CHECK9-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1391 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 8
1392 // CHECK9-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
1393 // CHECK9-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 8
1394 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
1395 // CHECK9-NEXT: store ptr null, ptr [[TMP15]], align 8
1396 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1397 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1398 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
1399 // CHECK9-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
1400 // CHECK9-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
1401 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1402 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
1403 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1404 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1405 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1406 // CHECK9-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1407 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
1408 // CHECK9-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
1409 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1410 // CHECK9-NEXT: store i32 3, ptr [[TMP23]], align 4
1411 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1412 // CHECK9-NEXT: store i32 3, ptr [[TMP24]], align 4
1413 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1414 // CHECK9-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 8
1415 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1416 // CHECK9-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 8
1417 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1418 // CHECK9-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 8
1419 // CHECK9-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1420 // CHECK9-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 8
1421 // CHECK9-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1422 // CHECK9-NEXT: store ptr null, ptr [[TMP29]], align 8
1423 // CHECK9-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1424 // CHECK9-NEXT: store ptr null, ptr [[TMP30]], align 8
1425 // CHECK9-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1426 // CHECK9-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
1427 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1428 // CHECK9-NEXT: store i64 0, ptr [[TMP32]], align 8
1429 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1430 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
1431 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1432 // CHECK9-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP34]], align 4
1433 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1434 // CHECK9-NEXT: store i32 0, ptr [[TMP35]], align 4
1435 // CHECK9-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75.region_id, ptr [[KERNEL_ARGS]])
1436 // CHECK9-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
1437 // CHECK9-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1438 // CHECK9: omp_offload.failed:
1439 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75(i64 [[TMP4]], i64 [[TMP1]], ptr [[VLA]]) #[[ATTR3:[0-9]+]]
1440 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
1441 // CHECK9: omp_offload.cont:
1442 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 0
1443 // CHECK9-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
1444 // CHECK9-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
1445 // CHECK9-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
1446 // CHECK9-NEXT: ret i32 [[TMP38]]
1449 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75
1450 // CHECK9-SAME: (i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
1451 // CHECK9-NEXT: entry:
1452 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
1453 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1454 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1455 // CHECK9-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
1456 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1457 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1458 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1459 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1460 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75.omp_outlined, ptr [[N_ADDR]], i64 [[TMP0]], ptr [[TMP1]])
1461 // CHECK9-NEXT: ret void
1464 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75.omp_outlined
1465 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] {
1466 // CHECK9-NEXT: entry:
1467 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1468 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1469 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
1470 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1471 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1472 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1473 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1474 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1475 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1476 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1477 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1478 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1479 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1480 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1481 // CHECK9-NEXT: [[I3:%.*]] = alloca i32, align 4
1482 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1483 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1484 // CHECK9-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
1485 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1486 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1487 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
1488 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1489 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1490 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1491 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1492 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1493 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1494 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1495 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1496 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1497 // CHECK9-NEXT: store i32 0, ptr [[I]], align 4
1498 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1499 // CHECK9-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1500 // CHECK9-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1501 // CHECK9: omp.precond.then:
1502 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1503 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1504 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
1505 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1506 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1507 // CHECK9-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1508 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
1509 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1510 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1511 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1512 // CHECK9-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
1513 // CHECK9-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1514 // CHECK9: cond.true:
1515 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1516 // CHECK9-NEXT: br label [[COND_END:%.*]]
1517 // CHECK9: cond.false:
1518 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1519 // CHECK9-NEXT: br label [[COND_END]]
1520 // CHECK9: cond.end:
1521 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1522 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1523 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1524 // CHECK9-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
1525 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1526 // CHECK9: omp.inner.for.cond:
1527 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4:![0-9]+]]
1528 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP4]]
1529 // CHECK9-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
1530 // CHECK9-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1531 // CHECK9: omp.inner.for.body:
1532 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
1533 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
1534 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1535 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP4]]
1536 // CHECK9-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP4]]
1537 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
1538 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
1539 // CHECK9-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP4]]
1540 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1541 // CHECK9: omp.body.continue:
1542 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1543 // CHECK9: omp.inner.for.inc:
1544 // CHECK9-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
1545 // CHECK9-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
1546 // CHECK9-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
1547 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP5:![0-9]+]]
1548 // CHECK9: omp.inner.for.end:
1549 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1550 // CHECK9: omp.loop.exit:
1551 // CHECK9-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1552 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
1553 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
1554 // CHECK9-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1555 // CHECK9-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
1556 // CHECK9-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1557 // CHECK9: .omp.final.then:
1558 // CHECK9-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1559 // CHECK9-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP23]], 0
1560 // CHECK9-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
1561 // CHECK9-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
1562 // CHECK9-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
1563 // CHECK9-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
1564 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
1565 // CHECK9: .omp.final.done:
1566 // CHECK9-NEXT: br label [[OMP_PRECOND_END]]
1567 // CHECK9: omp.precond.end:
1568 // CHECK9-NEXT: ret void
1571 // CHECK11-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1572 // CHECK11-SAME: () #[[ATTR0:[0-9]+]] {
1573 // CHECK11-NEXT: entry:
1574 // CHECK11-NEXT: [[N:%.*]] = alloca i32, align 4
1575 // CHECK11-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
1576 // CHECK11-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
1577 // CHECK11-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
1578 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
1579 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
1580 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
1581 // CHECK11-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
1582 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1583 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1584 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1585 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1586 // CHECK11-NEXT: store i32 100, ptr [[N]], align 4
1587 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1588 // CHECK11-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
1589 // CHECK11-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
1590 // CHECK11-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
1591 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
1592 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
1593 // CHECK11-NEXT: store i32 [[TMP2]], ptr [[N_CASTED]], align 4
1594 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[N_CASTED]], align 4
1595 // CHECK11-NEXT: [[TMP4:%.*]] = mul nuw i32 [[TMP0]], 4
1596 // CHECK11-NEXT: [[TMP5:%.*]] = sext i32 [[TMP4]] to i64
1597 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
1598 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1599 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[TMP6]], align 4
1600 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1601 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
1602 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
1603 // CHECK11-NEXT: store ptr null, ptr [[TMP8]], align 4
1604 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1605 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP9]], align 4
1606 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1607 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP10]], align 4
1608 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
1609 // CHECK11-NEXT: store ptr null, ptr [[TMP11]], align 4
1610 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1611 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 4
1612 // CHECK11-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1613 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 4
1614 // CHECK11-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
1615 // CHECK11-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 4
1616 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
1617 // CHECK11-NEXT: store ptr null, ptr [[TMP15]], align 4
1618 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1619 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1620 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
1621 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
1622 // CHECK11-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
1623 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1624 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
1625 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1626 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1627 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1628 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1629 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
1630 // CHECK11-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
1631 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1632 // CHECK11-NEXT: store i32 3, ptr [[TMP23]], align 4
1633 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1634 // CHECK11-NEXT: store i32 3, ptr [[TMP24]], align 4
1635 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1636 // CHECK11-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 4
1637 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1638 // CHECK11-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 4
1639 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1640 // CHECK11-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 4
1641 // CHECK11-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1642 // CHECK11-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 4
1643 // CHECK11-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1644 // CHECK11-NEXT: store ptr null, ptr [[TMP29]], align 4
1645 // CHECK11-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1646 // CHECK11-NEXT: store ptr null, ptr [[TMP30]], align 4
1647 // CHECK11-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1648 // CHECK11-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
1649 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1650 // CHECK11-NEXT: store i64 0, ptr [[TMP32]], align 8
1651 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1652 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
1653 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1654 // CHECK11-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP34]], align 4
1655 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1656 // CHECK11-NEXT: store i32 0, ptr [[TMP35]], align 4
1657 // CHECK11-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75.region_id, ptr [[KERNEL_ARGS]])
1658 // CHECK11-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
1659 // CHECK11-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1660 // CHECK11: omp_offload.failed:
1661 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75(i32 [[TMP3]], i32 [[TMP0]], ptr [[VLA]]) #[[ATTR3:[0-9]+]]
1662 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
1663 // CHECK11: omp_offload.cont:
1664 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 0
1665 // CHECK11-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
1666 // CHECK11-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
1667 // CHECK11-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
1668 // CHECK11-NEXT: ret i32 [[TMP38]]
1671 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75
1672 // CHECK11-SAME: (i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
1673 // CHECK11-NEXT: entry:
1674 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
1675 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
1676 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1677 // CHECK11-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
1678 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
1679 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1680 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
1681 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1682 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75.omp_outlined, ptr [[N_ADDR]], i32 [[TMP0]], ptr [[TMP1]])
1683 // CHECK11-NEXT: ret void
1686 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75.omp_outlined
1687 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] {
1688 // CHECK11-NEXT: entry:
1689 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1690 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1691 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
1692 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
1693 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1694 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1695 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1696 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1697 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1698 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1699 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1700 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1701 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1702 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1703 // CHECK11-NEXT: [[I3:%.*]] = alloca i32, align 4
1704 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1705 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1706 // CHECK11-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
1707 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
1708 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1709 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
1710 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
1711 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1712 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1713 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1714 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1715 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1716 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1717 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1718 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1719 // CHECK11-NEXT: store i32 0, ptr [[I]], align 4
1720 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1721 // CHECK11-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1722 // CHECK11-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1723 // CHECK11: omp.precond.then:
1724 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1725 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1726 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
1727 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1728 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1729 // CHECK11-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1730 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
1731 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1732 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1733 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1734 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
1735 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1736 // CHECK11: cond.true:
1737 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1738 // CHECK11-NEXT: br label [[COND_END:%.*]]
1739 // CHECK11: cond.false:
1740 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1741 // CHECK11-NEXT: br label [[COND_END]]
1742 // CHECK11: cond.end:
1743 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1744 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1745 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1746 // CHECK11-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
1747 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1748 // CHECK11: omp.inner.for.cond:
1749 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
1750 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
1751 // CHECK11-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
1752 // CHECK11-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1753 // CHECK11: omp.inner.for.body:
1754 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
1755 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
1756 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1757 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP5]]
1758 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP5]]
1759 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP17]]
1760 // CHECK11-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
1761 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1762 // CHECK11: omp.body.continue:
1763 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1764 // CHECK11: omp.inner.for.inc:
1765 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
1766 // CHECK11-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
1767 // CHECK11-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
1768 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
1769 // CHECK11: omp.inner.for.end:
1770 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1771 // CHECK11: omp.loop.exit:
1772 // CHECK11-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1773 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
1774 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
1775 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1776 // CHECK11-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
1777 // CHECK11-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1778 // CHECK11: .omp.final.then:
1779 // CHECK11-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1780 // CHECK11-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP23]], 0
1781 // CHECK11-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
1782 // CHECK11-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
1783 // CHECK11-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
1784 // CHECK11-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
1785 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
1786 // CHECK11: .omp.final.done:
1787 // CHECK11-NEXT: br label [[OMP_PRECOND_END]]
1788 // CHECK11: omp.precond.end:
1789 // CHECK11-NEXT: ret void
1792 // CHECK13-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1793 // CHECK13-SAME: () #[[ATTR0:[0-9]+]] {
1794 // CHECK13-NEXT: entry:
1795 // CHECK13-NEXT: [[N:%.*]] = alloca i32, align 4
1796 // CHECK13-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
1797 // CHECK13-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
1798 // CHECK13-NEXT: [[TMP:%.*]] = alloca i32, align 4
1799 // CHECK13-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1800 // CHECK13-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1801 // CHECK13-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1802 // CHECK13-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1803 // CHECK13-NEXT: [[I:%.*]] = alloca i32, align 4
1804 // CHECK13-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1805 // CHECK13-NEXT: [[I3:%.*]] = alloca i32, align 4
1806 // CHECK13-NEXT: store i32 100, ptr [[N]], align 4
1807 // CHECK13-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1808 // CHECK13-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
1809 // CHECK13-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
1810 // CHECK13-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
1811 // CHECK13-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
1812 // CHECK13-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
1813 // CHECK13-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
1814 // CHECK13-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1815 // CHECK13-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1816 // CHECK13-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1817 // CHECK13-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1818 // CHECK13-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1819 // CHECK13-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1820 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1821 // CHECK13-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1822 // CHECK13-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
1823 // CHECK13-NEXT: store i32 0, ptr [[I]], align 4
1824 // CHECK13-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1825 // CHECK13-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP6]]
1826 // CHECK13-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
1827 // CHECK13: simd.if.then:
1828 // CHECK13-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1829 // CHECK13-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
1830 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1831 // CHECK13: omp.inner.for.cond:
1832 // CHECK13-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
1833 // CHECK13-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
1834 // CHECK13-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
1835 // CHECK13-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1836 // CHECK13: omp.inner.for.body:
1837 // CHECK13-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1838 // CHECK13-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
1839 // CHECK13-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1840 // CHECK13-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP2]]
1841 // CHECK13-NEXT: [[TMP11:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP2]]
1842 // CHECK13-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
1843 // CHECK13-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 [[IDXPROM]]
1844 // CHECK13-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
1845 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1846 // CHECK13: omp.body.continue:
1847 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1848 // CHECK13: omp.inner.for.inc:
1849 // CHECK13-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1850 // CHECK13-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP12]], 1
1851 // CHECK13-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1852 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
1853 // CHECK13: omp.inner.for.end:
1854 // CHECK13-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1855 // CHECK13-NEXT: [[SUB6:%.*]] = sub nsw i32 [[TMP13]], 0
1856 // CHECK13-NEXT: [[DIV7:%.*]] = sdiv i32 [[SUB6]], 1
1857 // CHECK13-NEXT: [[MUL8:%.*]] = mul nsw i32 [[DIV7]], 1
1858 // CHECK13-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
1859 // CHECK13-NEXT: store i32 [[ADD9]], ptr [[I3]], align 4
1860 // CHECK13-NEXT: br label [[SIMD_IF_END]]
1861 // CHECK13: simd.if.end:
1862 // CHECK13-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 0
1863 // CHECK13-NEXT: [[TMP14:%.*]] = load i32, ptr [[ARRAYIDX10]], align 4
1864 // CHECK13-NEXT: [[TMP15:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
1865 // CHECK13-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP15]])
1866 // CHECK13-NEXT: ret i32 [[TMP14]]
1869 // CHECK15-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1870 // CHECK15-SAME: () #[[ATTR0:[0-9]+]] {
1871 // CHECK15-NEXT: entry:
1872 // CHECK15-NEXT: [[N:%.*]] = alloca i32, align 4
1873 // CHECK15-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
1874 // CHECK15-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
1875 // CHECK15-NEXT: [[TMP:%.*]] = alloca i32, align 4
1876 // CHECK15-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1877 // CHECK15-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1878 // CHECK15-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1879 // CHECK15-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1880 // CHECK15-NEXT: [[I:%.*]] = alloca i32, align 4
1881 // CHECK15-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1882 // CHECK15-NEXT: [[I3:%.*]] = alloca i32, align 4
1883 // CHECK15-NEXT: store i32 100, ptr [[N]], align 4
1884 // CHECK15-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1885 // CHECK15-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
1886 // CHECK15-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
1887 // CHECK15-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
1888 // CHECK15-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
1889 // CHECK15-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
1890 // CHECK15-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
1891 // CHECK15-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1892 // CHECK15-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
1893 // CHECK15-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1894 // CHECK15-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1895 // CHECK15-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1896 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1897 // CHECK15-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1898 // CHECK15-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_UB]], align 4
1899 // CHECK15-NEXT: store i32 0, ptr [[I]], align 4
1900 // CHECK15-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1901 // CHECK15-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1902 // CHECK15-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
1903 // CHECK15: simd.if.then:
1904 // CHECK15-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1905 // CHECK15-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1906 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1907 // CHECK15: omp.inner.for.cond:
1908 // CHECK15-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
1909 // CHECK15-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
1910 // CHECK15-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1911 // CHECK15-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1912 // CHECK15: omp.inner.for.body:
1913 // CHECK15-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1914 // CHECK15-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1915 // CHECK15-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1916 // CHECK15-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP3]]
1917 // CHECK15-NEXT: [[TMP10:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP3]]
1918 // CHECK15-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 [[TMP10]]
1919 // CHECK15-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
1920 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1921 // CHECK15: omp.body.continue:
1922 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1923 // CHECK15: omp.inner.for.inc:
1924 // CHECK15-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1925 // CHECK15-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP11]], 1
1926 // CHECK15-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1927 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
1928 // CHECK15: omp.inner.for.end:
1929 // CHECK15-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1930 // CHECK15-NEXT: [[SUB6:%.*]] = sub nsw i32 [[TMP12]], 0
1931 // CHECK15-NEXT: [[DIV7:%.*]] = sdiv i32 [[SUB6]], 1
1932 // CHECK15-NEXT: [[MUL8:%.*]] = mul nsw i32 [[DIV7]], 1
1933 // CHECK15-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
1934 // CHECK15-NEXT: store i32 [[ADD9]], ptr [[I3]], align 4
1935 // CHECK15-NEXT: br label [[SIMD_IF_END]]
1936 // CHECK15: simd.if.end:
1937 // CHECK15-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 0
1938 // CHECK15-NEXT: [[TMP13:%.*]] = load i32, ptr [[ARRAYIDX10]], align 4
1939 // CHECK15-NEXT: [[TMP14:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
1940 // CHECK15-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP14]])
1941 // CHECK15-NEXT: ret i32 [[TMP13]]
1944 // CHECK17-LABEL: define {{[^@]+}}@_Z21teams_template_structv
1945 // CHECK17-SAME: () #[[ATTR0:[0-9]+]] {
1946 // CHECK17-NEXT: entry:
1947 // CHECK17-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
1948 // CHECK17-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
1949 // CHECK17-NEXT: ret i32 [[CALL]]
1952 // CHECK17-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
1953 // CHECK17-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
1954 // CHECK17-NEXT: entry:
1955 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1956 // CHECK17-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
1957 // CHECK17-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
1958 // CHECK17-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
1959 // CHECK17-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
1960 // CHECK17-NEXT: [[TMP:%.*]] = alloca i32, align 4
1961 // CHECK17-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1962 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1963 // CHECK17-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1964 // CHECK17-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
1965 // CHECK17-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
1966 // CHECK17-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[B]], i32 1
1967 // CHECK17-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[TMP0]] to i64
1968 // CHECK17-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A]] to i64
1969 // CHECK17-NEXT: [[TMP3:%.*]] = sub i64 [[TMP1]], [[TMP2]]
1970 // CHECK17-NEXT: [[TMP4:%.*]] = sdiv exact i64 [[TMP3]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
1971 // CHECK17-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
1972 // CHECK17-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1973 // CHECK17-NEXT: store ptr [[THIS1]], ptr [[TMP5]], align 8
1974 // CHECK17-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1975 // CHECK17-NEXT: store ptr [[A]], ptr [[TMP6]], align 8
1976 // CHECK17-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
1977 // CHECK17-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
1978 // CHECK17-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
1979 // CHECK17-NEXT: store ptr null, ptr [[TMP8]], align 8
1980 // CHECK17-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1981 // CHECK17-NEXT: store ptr [[THIS1]], ptr [[TMP9]], align 8
1982 // CHECK17-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1983 // CHECK17-NEXT: store ptr [[B]], ptr [[TMP10]], align 8
1984 // CHECK17-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
1985 // CHECK17-NEXT: store ptr null, ptr [[TMP11]], align 8
1986 // CHECK17-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1987 // CHECK17-NEXT: store ptr [[THIS1]], ptr [[TMP12]], align 8
1988 // CHECK17-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1989 // CHECK17-NEXT: store ptr [[A]], ptr [[TMP13]], align 8
1990 // CHECK17-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
1991 // CHECK17-NEXT: store ptr null, ptr [[TMP14]], align 8
1992 // CHECK17-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1993 // CHECK17-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1994 // CHECK17-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
1995 // CHECK17-NEXT: [[TMP18:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1996 // CHECK17-NEXT: store i32 3, ptr [[TMP18]], align 4
1997 // CHECK17-NEXT: [[TMP19:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1998 // CHECK17-NEXT: store i32 3, ptr [[TMP19]], align 4
1999 // CHECK17-NEXT: [[TMP20:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2000 // CHECK17-NEXT: store ptr [[TMP15]], ptr [[TMP20]], align 8
2001 // CHECK17-NEXT: [[TMP21:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2002 // CHECK17-NEXT: store ptr [[TMP16]], ptr [[TMP21]], align 8
2003 // CHECK17-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2004 // CHECK17-NEXT: store ptr [[TMP17]], ptr [[TMP22]], align 8
2005 // CHECK17-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2006 // CHECK17-NEXT: store ptr @.offload_maptypes, ptr [[TMP23]], align 8
2007 // CHECK17-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2008 // CHECK17-NEXT: store ptr null, ptr [[TMP24]], align 8
2009 // CHECK17-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2010 // CHECK17-NEXT: store ptr null, ptr [[TMP25]], align 8
2011 // CHECK17-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2012 // CHECK17-NEXT: store i64 123, ptr [[TMP26]], align 8
2013 // CHECK17-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2014 // CHECK17-NEXT: store i64 0, ptr [[TMP27]], align 8
2015 // CHECK17-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2016 // CHECK17-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
2017 // CHECK17-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2018 // CHECK17-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP29]], align 4
2019 // CHECK17-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2020 // CHECK17-NEXT: store i32 0, ptr [[TMP30]], align 4
2021 // CHECK17-NEXT: [[TMP31:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.region_id, ptr [[KERNEL_ARGS]])
2022 // CHECK17-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
2023 // CHECK17-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2024 // CHECK17: omp_offload.failed:
2025 // CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123(ptr [[THIS1]]) #[[ATTR2:[0-9]+]]
2026 // CHECK17-NEXT: br label [[OMP_OFFLOAD_CONT]]
2027 // CHECK17: omp_offload.cont:
2028 // CHECK17-NEXT: [[A2:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2029 // CHECK17-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i64 0, i64 0
2030 // CHECK17-NEXT: [[TMP33:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2031 // CHECK17-NEXT: ret i32 [[TMP33]]
2034 // CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123
2035 // CHECK17-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2036 // CHECK17-NEXT: entry:
2037 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2038 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2039 // CHECK17-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2040 // CHECK17-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined, ptr [[TMP0]])
2041 // CHECK17-NEXT: ret void
2044 // CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined
2045 // CHECK17-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR1]] {
2046 // CHECK17-NEXT: entry:
2047 // CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2048 // CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2049 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2050 // CHECK17-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2051 // CHECK17-NEXT: [[TMP:%.*]] = alloca i32, align 4
2052 // CHECK17-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2053 // CHECK17-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2054 // CHECK17-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2055 // CHECK17-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2056 // CHECK17-NEXT: [[I:%.*]] = alloca i32, align 4
2057 // CHECK17-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2058 // CHECK17-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2059 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2060 // CHECK17-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2061 // CHECK17-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2062 // CHECK17-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2063 // CHECK17-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2064 // CHECK17-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2065 // CHECK17-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2066 // CHECK17-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2067 // CHECK17-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2068 // CHECK17-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2069 // CHECK17-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2070 // CHECK17-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2071 // CHECK17: cond.true:
2072 // CHECK17-NEXT: br label [[COND_END:%.*]]
2073 // CHECK17: cond.false:
2074 // CHECK17-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2075 // CHECK17-NEXT: br label [[COND_END]]
2076 // CHECK17: cond.end:
2077 // CHECK17-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2078 // CHECK17-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2079 // CHECK17-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2080 // CHECK17-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2081 // CHECK17-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2082 // CHECK17: omp.inner.for.cond:
2083 // CHECK17-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4:![0-9]+]]
2084 // CHECK17-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP4]]
2085 // CHECK17-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2086 // CHECK17-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2087 // CHECK17: omp.inner.for.body:
2088 // CHECK17-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2089 // CHECK17-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
2090 // CHECK17-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2091 // CHECK17-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP4]]
2092 // CHECK17-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2093 // CHECK17-NEXT: [[TMP9:%.*]] = load float, ptr [[B]], align 4, !llvm.access.group [[ACC_GRP4]]
2094 // CHECK17-NEXT: [[CONV:%.*]] = fptosi float [[TMP9]] to i32
2095 // CHECK17-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2096 // CHECK17-NEXT: [[TMP10:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP4]]
2097 // CHECK17-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP10]] to i64
2098 // CHECK17-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
2099 // CHECK17-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP4]]
2100 // CHECK17-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2101 // CHECK17: omp.body.continue:
2102 // CHECK17-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2103 // CHECK17: omp.inner.for.inc:
2104 // CHECK17-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2105 // CHECK17-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP11]], 1
2106 // CHECK17-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2107 // CHECK17-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP5:![0-9]+]]
2108 // CHECK17: omp.inner.for.end:
2109 // CHECK17-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2110 // CHECK17: omp.loop.exit:
2111 // CHECK17-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2112 // CHECK17-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2113 // CHECK17-NEXT: [[TMP13:%.*]] = icmp ne i32 [[TMP12]], 0
2114 // CHECK17-NEXT: br i1 [[TMP13]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2115 // CHECK17: .omp.final.then:
2116 // CHECK17-NEXT: store i32 123, ptr [[I]], align 4
2117 // CHECK17-NEXT: br label [[DOTOMP_FINAL_DONE]]
2118 // CHECK17: .omp.final.done:
2119 // CHECK17-NEXT: ret void
2122 // CHECK19-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2123 // CHECK19-SAME: () #[[ATTR0:[0-9]+]] {
2124 // CHECK19-NEXT: entry:
2125 // CHECK19-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2126 // CHECK19-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2127 // CHECK19-NEXT: ret i32 [[CALL]]
2130 // CHECK19-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2131 // CHECK19-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
2132 // CHECK19-NEXT: entry:
2133 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2134 // CHECK19-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
2135 // CHECK19-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
2136 // CHECK19-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
2137 // CHECK19-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
2138 // CHECK19-NEXT: [[TMP:%.*]] = alloca i32, align 4
2139 // CHECK19-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2140 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2141 // CHECK19-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2142 // CHECK19-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2143 // CHECK19-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2144 // CHECK19-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[B]], i32 1
2145 // CHECK19-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[TMP0]] to i64
2146 // CHECK19-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A]] to i64
2147 // CHECK19-NEXT: [[TMP3:%.*]] = sub i64 [[TMP1]], [[TMP2]]
2148 // CHECK19-NEXT: [[TMP4:%.*]] = sdiv exact i64 [[TMP3]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
2149 // CHECK19-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
2150 // CHECK19-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2151 // CHECK19-NEXT: store ptr [[THIS1]], ptr [[TMP5]], align 4
2152 // CHECK19-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2153 // CHECK19-NEXT: store ptr [[A]], ptr [[TMP6]], align 4
2154 // CHECK19-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2155 // CHECK19-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 4
2156 // CHECK19-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
2157 // CHECK19-NEXT: store ptr null, ptr [[TMP8]], align 4
2158 // CHECK19-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2159 // CHECK19-NEXT: store ptr [[THIS1]], ptr [[TMP9]], align 4
2160 // CHECK19-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2161 // CHECK19-NEXT: store ptr [[B]], ptr [[TMP10]], align 4
2162 // CHECK19-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
2163 // CHECK19-NEXT: store ptr null, ptr [[TMP11]], align 4
2164 // CHECK19-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2165 // CHECK19-NEXT: store ptr [[THIS1]], ptr [[TMP12]], align 4
2166 // CHECK19-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2167 // CHECK19-NEXT: store ptr [[A]], ptr [[TMP13]], align 4
2168 // CHECK19-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
2169 // CHECK19-NEXT: store ptr null, ptr [[TMP14]], align 4
2170 // CHECK19-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2171 // CHECK19-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2172 // CHECK19-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2173 // CHECK19-NEXT: [[TMP18:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2174 // CHECK19-NEXT: store i32 3, ptr [[TMP18]], align 4
2175 // CHECK19-NEXT: [[TMP19:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2176 // CHECK19-NEXT: store i32 3, ptr [[TMP19]], align 4
2177 // CHECK19-NEXT: [[TMP20:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2178 // CHECK19-NEXT: store ptr [[TMP15]], ptr [[TMP20]], align 4
2179 // CHECK19-NEXT: [[TMP21:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2180 // CHECK19-NEXT: store ptr [[TMP16]], ptr [[TMP21]], align 4
2181 // CHECK19-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2182 // CHECK19-NEXT: store ptr [[TMP17]], ptr [[TMP22]], align 4
2183 // CHECK19-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2184 // CHECK19-NEXT: store ptr @.offload_maptypes, ptr [[TMP23]], align 4
2185 // CHECK19-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2186 // CHECK19-NEXT: store ptr null, ptr [[TMP24]], align 4
2187 // CHECK19-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2188 // CHECK19-NEXT: store ptr null, ptr [[TMP25]], align 4
2189 // CHECK19-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2190 // CHECK19-NEXT: store i64 123, ptr [[TMP26]], align 8
2191 // CHECK19-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2192 // CHECK19-NEXT: store i64 0, ptr [[TMP27]], align 8
2193 // CHECK19-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2194 // CHECK19-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
2195 // CHECK19-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2196 // CHECK19-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP29]], align 4
2197 // CHECK19-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2198 // CHECK19-NEXT: store i32 0, ptr [[TMP30]], align 4
2199 // CHECK19-NEXT: [[TMP31:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.region_id, ptr [[KERNEL_ARGS]])
2200 // CHECK19-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
2201 // CHECK19-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2202 // CHECK19: omp_offload.failed:
2203 // CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123(ptr [[THIS1]]) #[[ATTR2:[0-9]+]]
2204 // CHECK19-NEXT: br label [[OMP_OFFLOAD_CONT]]
2205 // CHECK19: omp_offload.cont:
2206 // CHECK19-NEXT: [[A2:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2207 // CHECK19-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i32 0, i32 0
2208 // CHECK19-NEXT: [[TMP33:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2209 // CHECK19-NEXT: ret i32 [[TMP33]]
2212 // CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123
2213 // CHECK19-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2214 // CHECK19-NEXT: entry:
2215 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2216 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2217 // CHECK19-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2218 // CHECK19-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined, ptr [[TMP0]])
2219 // CHECK19-NEXT: ret void
2222 // CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined
2223 // CHECK19-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR1]] {
2224 // CHECK19-NEXT: entry:
2225 // CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2226 // CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2227 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2228 // CHECK19-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2229 // CHECK19-NEXT: [[TMP:%.*]] = alloca i32, align 4
2230 // CHECK19-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2231 // CHECK19-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2232 // CHECK19-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2233 // CHECK19-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2234 // CHECK19-NEXT: [[I:%.*]] = alloca i32, align 4
2235 // CHECK19-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2236 // CHECK19-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2237 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2238 // CHECK19-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2239 // CHECK19-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2240 // CHECK19-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2241 // CHECK19-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2242 // CHECK19-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2243 // CHECK19-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2244 // CHECK19-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2245 // CHECK19-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2246 // CHECK19-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2247 // CHECK19-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2248 // CHECK19-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2249 // CHECK19: cond.true:
2250 // CHECK19-NEXT: br label [[COND_END:%.*]]
2251 // CHECK19: cond.false:
2252 // CHECK19-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2253 // CHECK19-NEXT: br label [[COND_END]]
2254 // CHECK19: cond.end:
2255 // CHECK19-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2256 // CHECK19-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2257 // CHECK19-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2258 // CHECK19-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2259 // CHECK19-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2260 // CHECK19: omp.inner.for.cond:
2261 // CHECK19-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
2262 // CHECK19-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
2263 // CHECK19-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2264 // CHECK19-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2265 // CHECK19: omp.inner.for.body:
2266 // CHECK19-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2267 // CHECK19-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
2268 // CHECK19-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2269 // CHECK19-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP5]]
2270 // CHECK19-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2271 // CHECK19-NEXT: [[TMP9:%.*]] = load float, ptr [[B]], align 4, !llvm.access.group [[ACC_GRP5]]
2272 // CHECK19-NEXT: [[CONV:%.*]] = fptosi float [[TMP9]] to i32
2273 // CHECK19-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2274 // CHECK19-NEXT: [[TMP10:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP5]]
2275 // CHECK19-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP10]]
2276 // CHECK19-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
2277 // CHECK19-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2278 // CHECK19: omp.body.continue:
2279 // CHECK19-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2280 // CHECK19: omp.inner.for.inc:
2281 // CHECK19-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2282 // CHECK19-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP11]], 1
2283 // CHECK19-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2284 // CHECK19-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
2285 // CHECK19: omp.inner.for.end:
2286 // CHECK19-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2287 // CHECK19: omp.loop.exit:
2288 // CHECK19-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2289 // CHECK19-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2290 // CHECK19-NEXT: [[TMP13:%.*]] = icmp ne i32 [[TMP12]], 0
2291 // CHECK19-NEXT: br i1 [[TMP13]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2292 // CHECK19: .omp.final.then:
2293 // CHECK19-NEXT: store i32 123, ptr [[I]], align 4
2294 // CHECK19-NEXT: br label [[DOTOMP_FINAL_DONE]]
2295 // CHECK19: .omp.final.done:
2296 // CHECK19-NEXT: ret void
2299 // CHECK21-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2300 // CHECK21-SAME: () #[[ATTR0:[0-9]+]] {
2301 // CHECK21-NEXT: entry:
2302 // CHECK21-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2303 // CHECK21-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2304 // CHECK21-NEXT: ret i32 [[CALL]]
2307 // CHECK21-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2308 // CHECK21-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
2309 // CHECK21-NEXT: entry:
2310 // CHECK21-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2311 // CHECK21-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
2312 // CHECK21-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
2313 // CHECK21-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
2314 // CHECK21-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
2315 // CHECK21-NEXT: [[TMP:%.*]] = alloca i32, align 4
2316 // CHECK21-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2317 // CHECK21-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2318 // CHECK21-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2319 // CHECK21-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2320 // CHECK21-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2321 // CHECK21-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[B]], i32 1
2322 // CHECK21-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[TMP0]] to i64
2323 // CHECK21-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A]] to i64
2324 // CHECK21-NEXT: [[TMP3:%.*]] = sub i64 [[TMP1]], [[TMP2]]
2325 // CHECK21-NEXT: [[TMP4:%.*]] = sdiv exact i64 [[TMP3]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
2326 // CHECK21-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
2327 // CHECK21-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2328 // CHECK21-NEXT: store ptr [[THIS1]], ptr [[TMP5]], align 8
2329 // CHECK21-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2330 // CHECK21-NEXT: store ptr [[A]], ptr [[TMP6]], align 8
2331 // CHECK21-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2332 // CHECK21-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
2333 // CHECK21-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
2334 // CHECK21-NEXT: store ptr null, ptr [[TMP8]], align 8
2335 // CHECK21-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2336 // CHECK21-NEXT: store ptr [[THIS1]], ptr [[TMP9]], align 8
2337 // CHECK21-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2338 // CHECK21-NEXT: store ptr [[B]], ptr [[TMP10]], align 8
2339 // CHECK21-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
2340 // CHECK21-NEXT: store ptr null, ptr [[TMP11]], align 8
2341 // CHECK21-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2342 // CHECK21-NEXT: store ptr [[THIS1]], ptr [[TMP12]], align 8
2343 // CHECK21-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2344 // CHECK21-NEXT: store ptr [[A]], ptr [[TMP13]], align 8
2345 // CHECK21-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
2346 // CHECK21-NEXT: store ptr null, ptr [[TMP14]], align 8
2347 // CHECK21-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2348 // CHECK21-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2349 // CHECK21-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2350 // CHECK21-NEXT: [[TMP18:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2351 // CHECK21-NEXT: store i32 3, ptr [[TMP18]], align 4
2352 // CHECK21-NEXT: [[TMP19:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2353 // CHECK21-NEXT: store i32 3, ptr [[TMP19]], align 4
2354 // CHECK21-NEXT: [[TMP20:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2355 // CHECK21-NEXT: store ptr [[TMP15]], ptr [[TMP20]], align 8
2356 // CHECK21-NEXT: [[TMP21:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2357 // CHECK21-NEXT: store ptr [[TMP16]], ptr [[TMP21]], align 8
2358 // CHECK21-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2359 // CHECK21-NEXT: store ptr [[TMP17]], ptr [[TMP22]], align 8
2360 // CHECK21-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2361 // CHECK21-NEXT: store ptr @.offload_maptypes, ptr [[TMP23]], align 8
2362 // CHECK21-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2363 // CHECK21-NEXT: store ptr null, ptr [[TMP24]], align 8
2364 // CHECK21-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2365 // CHECK21-NEXT: store ptr null, ptr [[TMP25]], align 8
2366 // CHECK21-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2367 // CHECK21-NEXT: store i64 123, ptr [[TMP26]], align 8
2368 // CHECK21-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2369 // CHECK21-NEXT: store i64 0, ptr [[TMP27]], align 8
2370 // CHECK21-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2371 // CHECK21-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
2372 // CHECK21-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2373 // CHECK21-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP29]], align 4
2374 // CHECK21-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2375 // CHECK21-NEXT: store i32 0, ptr [[TMP30]], align 4
2376 // CHECK21-NEXT: [[TMP31:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.region_id, ptr [[KERNEL_ARGS]])
2377 // CHECK21-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
2378 // CHECK21-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2379 // CHECK21: omp_offload.failed:
2380 // CHECK21-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123(ptr [[THIS1]]) #[[ATTR2:[0-9]+]]
2381 // CHECK21-NEXT: br label [[OMP_OFFLOAD_CONT]]
2382 // CHECK21: omp_offload.cont:
2383 // CHECK21-NEXT: [[A2:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2384 // CHECK21-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i64 0, i64 0
2385 // CHECK21-NEXT: [[TMP33:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2386 // CHECK21-NEXT: ret i32 [[TMP33]]
2389 // CHECK21-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123
2390 // CHECK21-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2391 // CHECK21-NEXT: entry:
2392 // CHECK21-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2393 // CHECK21-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2394 // CHECK21-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
2395 // CHECK21-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2396 // CHECK21-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2397 // CHECK21-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2398 // CHECK21-NEXT: [[TMP1:%.*]] = load float, ptr [[B]], align 4
2399 // CHECK21-NEXT: [[TOBOOL:%.*]] = fcmp une float [[TMP1]], 0.000000e+00
2400 // CHECK21-NEXT: [[STOREDV:%.*]] = zext i1 [[TOBOOL]] to i8
2401 // CHECK21-NEXT: store i8 [[STOREDV]], ptr [[DOTCAPTURE_EXPR_]], align 1
2402 // CHECK21-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2403 // CHECK21-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP2]] to i1
2404 // CHECK21-NEXT: [[STOREDV1:%.*]] = zext i1 [[LOADEDV]] to i8
2405 // CHECK21-NEXT: store i8 [[STOREDV1]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
2406 // CHECK21-NEXT: [[TMP3:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
2407 // CHECK21-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined, ptr [[TMP0]], i64 [[TMP3]])
2408 // CHECK21-NEXT: ret void
2411 // CHECK21-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined
2412 // CHECK21-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
2413 // CHECK21-NEXT: entry:
2414 // CHECK21-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2415 // CHECK21-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2416 // CHECK21-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2417 // CHECK21-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
2418 // CHECK21-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2419 // CHECK21-NEXT: [[TMP:%.*]] = alloca i32, align 4
2420 // CHECK21-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2421 // CHECK21-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2422 // CHECK21-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2423 // CHECK21-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2424 // CHECK21-NEXT: [[I:%.*]] = alloca i32, align 4
2425 // CHECK21-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2426 // CHECK21-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2427 // CHECK21-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2428 // CHECK21-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
2429 // CHECK21-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2430 // CHECK21-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2431 // CHECK21-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2432 // CHECK21-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2433 // CHECK21-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2434 // CHECK21-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2435 // CHECK21-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2436 // CHECK21-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2437 // CHECK21-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2438 // CHECK21-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2439 // CHECK21-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2440 // CHECK21: cond.true:
2441 // CHECK21-NEXT: br label [[COND_END:%.*]]
2442 // CHECK21: cond.false:
2443 // CHECK21-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2444 // CHECK21-NEXT: br label [[COND_END]]
2445 // CHECK21: cond.end:
2446 // CHECK21-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2447 // CHECK21-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2448 // CHECK21-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2449 // CHECK21-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2450 // CHECK21-NEXT: [[TMP6:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2451 // CHECK21-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP6]] to i1
2452 // CHECK21-NEXT: br i1 [[LOADEDV]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2453 // CHECK21: omp_if.then:
2454 // CHECK21-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2455 // CHECK21: omp.inner.for.cond:
2456 // CHECK21-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4:![0-9]+]]
2457 // CHECK21-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP4]]
2458 // CHECK21-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2459 // CHECK21-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2460 // CHECK21: omp.inner.for.body:
2461 // CHECK21-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2462 // CHECK21-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2463 // CHECK21-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2464 // CHECK21-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP4]]
2465 // CHECK21-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2466 // CHECK21-NEXT: [[TMP10:%.*]] = load float, ptr [[B]], align 4, !nontemporal [[META5:![0-9]+]], !llvm.access.group [[ACC_GRP4]]
2467 // CHECK21-NEXT: [[CONV:%.*]] = fptosi float [[TMP10]] to i32
2468 // CHECK21-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2469 // CHECK21-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP4]]
2470 // CHECK21-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
2471 // CHECK21-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
2472 // CHECK21-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP4]]
2473 // CHECK21-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2474 // CHECK21: omp.body.continue:
2475 // CHECK21-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2476 // CHECK21: omp.inner.for.inc:
2477 // CHECK21-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2478 // CHECK21-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP12]], 1
2479 // CHECK21-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2480 // CHECK21-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
2481 // CHECK21: omp.inner.for.end:
2482 // CHECK21-NEXT: br label [[OMP_IF_END:%.*]]
2483 // CHECK21: omp_if.else:
2484 // CHECK21-NEXT: br label [[OMP_INNER_FOR_COND3:%.*]]
2485 // CHECK21: omp.inner.for.cond3:
2486 // CHECK21-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2487 // CHECK21-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2488 // CHECK21-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
2489 // CHECK21-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY5:%.*]], label [[OMP_INNER_FOR_END16:%.*]]
2490 // CHECK21: omp.inner.for.body5:
2491 // CHECK21-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2492 // CHECK21-NEXT: [[MUL6:%.*]] = mul nsw i32 [[TMP15]], 1
2493 // CHECK21-NEXT: [[ADD7:%.*]] = add nsw i32 0, [[MUL6]]
2494 // CHECK21-NEXT: store i32 [[ADD7]], ptr [[I]], align 4
2495 // CHECK21-NEXT: [[B8:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 1
2496 // CHECK21-NEXT: [[TMP16:%.*]] = load float, ptr [[B8]], align 4
2497 // CHECK21-NEXT: [[CONV9:%.*]] = fptosi float [[TMP16]] to i32
2498 // CHECK21-NEXT: [[A10:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2499 // CHECK21-NEXT: [[TMP17:%.*]] = load i32, ptr [[I]], align 4
2500 // CHECK21-NEXT: [[IDXPROM11:%.*]] = sext i32 [[TMP17]] to i64
2501 // CHECK21-NEXT: [[ARRAYIDX12:%.*]] = getelementptr inbounds [123 x i32], ptr [[A10]], i64 0, i64 [[IDXPROM11]]
2502 // CHECK21-NEXT: store i32 [[CONV9]], ptr [[ARRAYIDX12]], align 4
2503 // CHECK21-NEXT: br label [[OMP_BODY_CONTINUE13:%.*]]
2504 // CHECK21: omp.body.continue13:
2505 // CHECK21-NEXT: br label [[OMP_INNER_FOR_INC14:%.*]]
2506 // CHECK21: omp.inner.for.inc14:
2507 // CHECK21-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2508 // CHECK21-NEXT: [[ADD15:%.*]] = add nsw i32 [[TMP18]], 1
2509 // CHECK21-NEXT: store i32 [[ADD15]], ptr [[DOTOMP_IV]], align 4
2510 // CHECK21-NEXT: br label [[OMP_INNER_FOR_COND3]], !llvm.loop [[LOOP9:![0-9]+]]
2511 // CHECK21: omp.inner.for.end16:
2512 // CHECK21-NEXT: br label [[OMP_IF_END]]
2513 // CHECK21: omp_if.end:
2514 // CHECK21-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2515 // CHECK21: omp.loop.exit:
2516 // CHECK21-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2517 // CHECK21-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2518 // CHECK21-NEXT: [[TMP20:%.*]] = icmp ne i32 [[TMP19]], 0
2519 // CHECK21-NEXT: br i1 [[TMP20]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2520 // CHECK21: .omp.final.then:
2521 // CHECK21-NEXT: store i32 123, ptr [[I]], align 4
2522 // CHECK21-NEXT: br label [[DOTOMP_FINAL_DONE]]
2523 // CHECK21: .omp.final.done:
2524 // CHECK21-NEXT: ret void
2527 // CHECK23-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2528 // CHECK23-SAME: () #[[ATTR0:[0-9]+]] {
2529 // CHECK23-NEXT: entry:
2530 // CHECK23-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2531 // CHECK23-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2532 // CHECK23-NEXT: ret i32 [[CALL]]
2535 // CHECK23-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2536 // CHECK23-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
2537 // CHECK23-NEXT: entry:
2538 // CHECK23-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2539 // CHECK23-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
2540 // CHECK23-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
2541 // CHECK23-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
2542 // CHECK23-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
2543 // CHECK23-NEXT: [[TMP:%.*]] = alloca i32, align 4
2544 // CHECK23-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2545 // CHECK23-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2546 // CHECK23-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2547 // CHECK23-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2548 // CHECK23-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2549 // CHECK23-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[B]], i32 1
2550 // CHECK23-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[TMP0]] to i64
2551 // CHECK23-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A]] to i64
2552 // CHECK23-NEXT: [[TMP3:%.*]] = sub i64 [[TMP1]], [[TMP2]]
2553 // CHECK23-NEXT: [[TMP4:%.*]] = sdiv exact i64 [[TMP3]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
2554 // CHECK23-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
2555 // CHECK23-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2556 // CHECK23-NEXT: store ptr [[THIS1]], ptr [[TMP5]], align 4
2557 // CHECK23-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2558 // CHECK23-NEXT: store ptr [[A]], ptr [[TMP6]], align 4
2559 // CHECK23-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2560 // CHECK23-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 4
2561 // CHECK23-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
2562 // CHECK23-NEXT: store ptr null, ptr [[TMP8]], align 4
2563 // CHECK23-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2564 // CHECK23-NEXT: store ptr [[THIS1]], ptr [[TMP9]], align 4
2565 // CHECK23-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2566 // CHECK23-NEXT: store ptr [[B]], ptr [[TMP10]], align 4
2567 // CHECK23-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
2568 // CHECK23-NEXT: store ptr null, ptr [[TMP11]], align 4
2569 // CHECK23-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2570 // CHECK23-NEXT: store ptr [[THIS1]], ptr [[TMP12]], align 4
2571 // CHECK23-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2572 // CHECK23-NEXT: store ptr [[A]], ptr [[TMP13]], align 4
2573 // CHECK23-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
2574 // CHECK23-NEXT: store ptr null, ptr [[TMP14]], align 4
2575 // CHECK23-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2576 // CHECK23-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2577 // CHECK23-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2578 // CHECK23-NEXT: [[TMP18:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2579 // CHECK23-NEXT: store i32 3, ptr [[TMP18]], align 4
2580 // CHECK23-NEXT: [[TMP19:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2581 // CHECK23-NEXT: store i32 3, ptr [[TMP19]], align 4
2582 // CHECK23-NEXT: [[TMP20:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2583 // CHECK23-NEXT: store ptr [[TMP15]], ptr [[TMP20]], align 4
2584 // CHECK23-NEXT: [[TMP21:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2585 // CHECK23-NEXT: store ptr [[TMP16]], ptr [[TMP21]], align 4
2586 // CHECK23-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2587 // CHECK23-NEXT: store ptr [[TMP17]], ptr [[TMP22]], align 4
2588 // CHECK23-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2589 // CHECK23-NEXT: store ptr @.offload_maptypes, ptr [[TMP23]], align 4
2590 // CHECK23-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2591 // CHECK23-NEXT: store ptr null, ptr [[TMP24]], align 4
2592 // CHECK23-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2593 // CHECK23-NEXT: store ptr null, ptr [[TMP25]], align 4
2594 // CHECK23-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2595 // CHECK23-NEXT: store i64 123, ptr [[TMP26]], align 8
2596 // CHECK23-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2597 // CHECK23-NEXT: store i64 0, ptr [[TMP27]], align 8
2598 // CHECK23-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2599 // CHECK23-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
2600 // CHECK23-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2601 // CHECK23-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP29]], align 4
2602 // CHECK23-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2603 // CHECK23-NEXT: store i32 0, ptr [[TMP30]], align 4
2604 // CHECK23-NEXT: [[TMP31:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.region_id, ptr [[KERNEL_ARGS]])
2605 // CHECK23-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
2606 // CHECK23-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2607 // CHECK23: omp_offload.failed:
2608 // CHECK23-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123(ptr [[THIS1]]) #[[ATTR2:[0-9]+]]
2609 // CHECK23-NEXT: br label [[OMP_OFFLOAD_CONT]]
2610 // CHECK23: omp_offload.cont:
2611 // CHECK23-NEXT: [[A2:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2612 // CHECK23-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i32 0, i32 0
2613 // CHECK23-NEXT: [[TMP33:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2614 // CHECK23-NEXT: ret i32 [[TMP33]]
2617 // CHECK23-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123
2618 // CHECK23-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2619 // CHECK23-NEXT: entry:
2620 // CHECK23-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2621 // CHECK23-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2622 // CHECK23-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
2623 // CHECK23-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2624 // CHECK23-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2625 // CHECK23-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2626 // CHECK23-NEXT: [[TMP1:%.*]] = load float, ptr [[B]], align 4
2627 // CHECK23-NEXT: [[TOBOOL:%.*]] = fcmp une float [[TMP1]], 0.000000e+00
2628 // CHECK23-NEXT: [[STOREDV:%.*]] = zext i1 [[TOBOOL]] to i8
2629 // CHECK23-NEXT: store i8 [[STOREDV]], ptr [[DOTCAPTURE_EXPR_]], align 1
2630 // CHECK23-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2631 // CHECK23-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP2]] to i1
2632 // CHECK23-NEXT: [[STOREDV1:%.*]] = zext i1 [[LOADEDV]] to i8
2633 // CHECK23-NEXT: store i8 [[STOREDV1]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
2634 // CHECK23-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR__CASTED]], align 4
2635 // CHECK23-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined, ptr [[TMP0]], i32 [[TMP3]])
2636 // CHECK23-NEXT: ret void
2639 // CHECK23-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined
2640 // CHECK23-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
2641 // CHECK23-NEXT: entry:
2642 // CHECK23-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2643 // CHECK23-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2644 // CHECK23-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2645 // CHECK23-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
2646 // CHECK23-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2647 // CHECK23-NEXT: [[TMP:%.*]] = alloca i32, align 4
2648 // CHECK23-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2649 // CHECK23-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2650 // CHECK23-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2651 // CHECK23-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2652 // CHECK23-NEXT: [[I:%.*]] = alloca i32, align 4
2653 // CHECK23-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2654 // CHECK23-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2655 // CHECK23-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2656 // CHECK23-NEXT: store i32 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 4
2657 // CHECK23-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2658 // CHECK23-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2659 // CHECK23-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2660 // CHECK23-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2661 // CHECK23-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2662 // CHECK23-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2663 // CHECK23-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2664 // CHECK23-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2665 // CHECK23-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2666 // CHECK23-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2667 // CHECK23-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2668 // CHECK23: cond.true:
2669 // CHECK23-NEXT: br label [[COND_END:%.*]]
2670 // CHECK23: cond.false:
2671 // CHECK23-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2672 // CHECK23-NEXT: br label [[COND_END]]
2673 // CHECK23: cond.end:
2674 // CHECK23-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2675 // CHECK23-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2676 // CHECK23-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2677 // CHECK23-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2678 // CHECK23-NEXT: [[TMP6:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2679 // CHECK23-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP6]] to i1
2680 // CHECK23-NEXT: br i1 [[LOADEDV]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2681 // CHECK23: omp_if.then:
2682 // CHECK23-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2683 // CHECK23: omp.inner.for.cond:
2684 // CHECK23-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
2685 // CHECK23-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
2686 // CHECK23-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2687 // CHECK23-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2688 // CHECK23: omp.inner.for.body:
2689 // CHECK23-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2690 // CHECK23-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2691 // CHECK23-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2692 // CHECK23-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP5]]
2693 // CHECK23-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2694 // CHECK23-NEXT: [[TMP10:%.*]] = load float, ptr [[B]], align 4, !nontemporal [[META6:![0-9]+]], !llvm.access.group [[ACC_GRP5]]
2695 // CHECK23-NEXT: [[CONV:%.*]] = fptosi float [[TMP10]] to i32
2696 // CHECK23-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2697 // CHECK23-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP5]]
2698 // CHECK23-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP11]]
2699 // CHECK23-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
2700 // CHECK23-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2701 // CHECK23: omp.body.continue:
2702 // CHECK23-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2703 // CHECK23: omp.inner.for.inc:
2704 // CHECK23-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2705 // CHECK23-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP12]], 1
2706 // CHECK23-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2707 // CHECK23-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
2708 // CHECK23: omp.inner.for.end:
2709 // CHECK23-NEXT: br label [[OMP_IF_END:%.*]]
2710 // CHECK23: omp_if.else:
2711 // CHECK23-NEXT: br label [[OMP_INNER_FOR_COND3:%.*]]
2712 // CHECK23: omp.inner.for.cond3:
2713 // CHECK23-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2714 // CHECK23-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2715 // CHECK23-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
2716 // CHECK23-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY5:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
2717 // CHECK23: omp.inner.for.body5:
2718 // CHECK23-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2719 // CHECK23-NEXT: [[MUL6:%.*]] = mul nsw i32 [[TMP15]], 1
2720 // CHECK23-NEXT: [[ADD7:%.*]] = add nsw i32 0, [[MUL6]]
2721 // CHECK23-NEXT: store i32 [[ADD7]], ptr [[I]], align 4
2722 // CHECK23-NEXT: [[B8:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 1
2723 // CHECK23-NEXT: [[TMP16:%.*]] = load float, ptr [[B8]], align 4
2724 // CHECK23-NEXT: [[CONV9:%.*]] = fptosi float [[TMP16]] to i32
2725 // CHECK23-NEXT: [[A10:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2726 // CHECK23-NEXT: [[TMP17:%.*]] = load i32, ptr [[I]], align 4
2727 // CHECK23-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [123 x i32], ptr [[A10]], i32 0, i32 [[TMP17]]
2728 // CHECK23-NEXT: store i32 [[CONV9]], ptr [[ARRAYIDX11]], align 4
2729 // CHECK23-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
2730 // CHECK23: omp.body.continue12:
2731 // CHECK23-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
2732 // CHECK23: omp.inner.for.inc13:
2733 // CHECK23-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2734 // CHECK23-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP18]], 1
2735 // CHECK23-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV]], align 4
2736 // CHECK23-NEXT: br label [[OMP_INNER_FOR_COND3]], !llvm.loop [[LOOP10:![0-9]+]]
2737 // CHECK23: omp.inner.for.end15:
2738 // CHECK23-NEXT: br label [[OMP_IF_END]]
2739 // CHECK23: omp_if.end:
2740 // CHECK23-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2741 // CHECK23: omp.loop.exit:
2742 // CHECK23-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2743 // CHECK23-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2744 // CHECK23-NEXT: [[TMP20:%.*]] = icmp ne i32 [[TMP19]], 0
2745 // CHECK23-NEXT: br i1 [[TMP20]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2746 // CHECK23: .omp.final.then:
2747 // CHECK23-NEXT: store i32 123, ptr [[I]], align 4
2748 // CHECK23-NEXT: br label [[DOTOMP_FINAL_DONE]]
2749 // CHECK23: .omp.final.done:
2750 // CHECK23-NEXT: ret void
2753 // CHECK25-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2754 // CHECK25-SAME: () #[[ATTR0:[0-9]+]] {
2755 // CHECK25-NEXT: entry:
2756 // CHECK25-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2757 // CHECK25-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2758 // CHECK25-NEXT: ret i32 [[CALL]]
2761 // CHECK25-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2762 // CHECK25-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
2763 // CHECK25-NEXT: entry:
2764 // CHECK25-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2765 // CHECK25-NEXT: [[TMP:%.*]] = alloca i32, align 4
2766 // CHECK25-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2767 // CHECK25-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2768 // CHECK25-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2769 // CHECK25-NEXT: [[I:%.*]] = alloca i32, align 4
2770 // CHECK25-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2771 // CHECK25-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2772 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2773 // CHECK25-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2774 // CHECK25-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2775 // CHECK25-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
2776 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2777 // CHECK25: omp.inner.for.cond:
2778 // CHECK25-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
2779 // CHECK25-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
2780 // CHECK25-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
2781 // CHECK25-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2782 // CHECK25: omp.inner.for.body:
2783 // CHECK25-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2784 // CHECK25-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
2785 // CHECK25-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2786 // CHECK25-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
2787 // CHECK25-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2788 // CHECK25-NEXT: [[TMP4:%.*]] = load float, ptr [[B]], align 4, !llvm.access.group [[ACC_GRP2]]
2789 // CHECK25-NEXT: [[CONV:%.*]] = fptosi float [[TMP4]] to i32
2790 // CHECK25-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2791 // CHECK25-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
2792 // CHECK25-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP5]] to i64
2793 // CHECK25-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
2794 // CHECK25-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
2795 // CHECK25-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2796 // CHECK25: omp.body.continue:
2797 // CHECK25-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2798 // CHECK25: omp.inner.for.inc:
2799 // CHECK25-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2800 // CHECK25-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP6]], 1
2801 // CHECK25-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2802 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
2803 // CHECK25: omp.inner.for.end:
2804 // CHECK25-NEXT: store i32 123, ptr [[I]], align 4
2805 // CHECK25-NEXT: [[A3:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2806 // CHECK25-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [123 x i32], ptr [[A3]], i64 0, i64 0
2807 // CHECK25-NEXT: [[TMP7:%.*]] = load i32, ptr [[ARRAYIDX4]], align 4
2808 // CHECK25-NEXT: ret i32 [[TMP7]]
2811 // CHECK27-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2812 // CHECK27-SAME: () #[[ATTR0:[0-9]+]] {
2813 // CHECK27-NEXT: entry:
2814 // CHECK27-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2815 // CHECK27-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2816 // CHECK27-NEXT: ret i32 [[CALL]]
2819 // CHECK27-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2820 // CHECK27-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
2821 // CHECK27-NEXT: entry:
2822 // CHECK27-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2823 // CHECK27-NEXT: [[TMP:%.*]] = alloca i32, align 4
2824 // CHECK27-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2825 // CHECK27-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2826 // CHECK27-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2827 // CHECK27-NEXT: [[I:%.*]] = alloca i32, align 4
2828 // CHECK27-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2829 // CHECK27-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2830 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2831 // CHECK27-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2832 // CHECK27-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2833 // CHECK27-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
2834 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2835 // CHECK27: omp.inner.for.cond:
2836 // CHECK27-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
2837 // CHECK27-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
2838 // CHECK27-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
2839 // CHECK27-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2840 // CHECK27: omp.inner.for.body:
2841 // CHECK27-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
2842 // CHECK27-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
2843 // CHECK27-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2844 // CHECK27-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP3]]
2845 // CHECK27-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2846 // CHECK27-NEXT: [[TMP4:%.*]] = load float, ptr [[B]], align 4, !llvm.access.group [[ACC_GRP3]]
2847 // CHECK27-NEXT: [[CONV:%.*]] = fptosi float [[TMP4]] to i32
2848 // CHECK27-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2849 // CHECK27-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP3]]
2850 // CHECK27-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP5]]
2851 // CHECK27-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
2852 // CHECK27-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2853 // CHECK27: omp.body.continue:
2854 // CHECK27-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2855 // CHECK27: omp.inner.for.inc:
2856 // CHECK27-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
2857 // CHECK27-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP6]], 1
2858 // CHECK27-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
2859 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
2860 // CHECK27: omp.inner.for.end:
2861 // CHECK27-NEXT: store i32 123, ptr [[I]], align 4
2862 // CHECK27-NEXT: [[A3:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2863 // CHECK27-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [123 x i32], ptr [[A3]], i32 0, i32 0
2864 // CHECK27-NEXT: [[TMP7:%.*]] = load i32, ptr [[ARRAYIDX4]], align 4
2865 // CHECK27-NEXT: ret i32 [[TMP7]]
2868 // CHECK29-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2869 // CHECK29-SAME: () #[[ATTR0:[0-9]+]] {
2870 // CHECK29-NEXT: entry:
2871 // CHECK29-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2872 // CHECK29-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2873 // CHECK29-NEXT: ret i32 [[CALL]]
2876 // CHECK29-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2877 // CHECK29-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
2878 // CHECK29-NEXT: entry:
2879 // CHECK29-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2880 // CHECK29-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2881 // CHECK29-NEXT: [[TMP:%.*]] = alloca i32, align 4
2882 // CHECK29-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2883 // CHECK29-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2884 // CHECK29-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2885 // CHECK29-NEXT: [[I:%.*]] = alloca i32, align 4
2886 // CHECK29-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2887 // CHECK29-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2888 // CHECK29-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2889 // CHECK29-NEXT: [[TMP0:%.*]] = load float, ptr [[B]], align 4
2890 // CHECK29-NEXT: [[TOBOOL:%.*]] = fcmp une float [[TMP0]], 0.000000e+00
2891 // CHECK29-NEXT: [[STOREDV:%.*]] = zext i1 [[TOBOOL]] to i8
2892 // CHECK29-NEXT: store i8 [[STOREDV]], ptr [[DOTCAPTURE_EXPR_]], align 1
2893 // CHECK29-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2894 // CHECK29-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2895 // CHECK29-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2896 // CHECK29-NEXT: store i32 [[TMP1]], ptr [[DOTOMP_IV]], align 4
2897 // CHECK29-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2898 // CHECK29-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP2]] to i1
2899 // CHECK29-NEXT: br i1 [[LOADEDV]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2900 // CHECK29: omp_if.then:
2901 // CHECK29-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2902 // CHECK29: omp.inner.for.cond:
2903 // CHECK29-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
2904 // CHECK29-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
2905 // CHECK29-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP3]], [[TMP4]]
2906 // CHECK29-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2907 // CHECK29: omp.inner.for.body:
2908 // CHECK29-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2909 // CHECK29-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP5]], 1
2910 // CHECK29-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2911 // CHECK29-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
2912 // CHECK29-NEXT: [[B2:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
2913 // CHECK29-NEXT: [[TMP6:%.*]] = load float, ptr [[B2]], align 4, !nontemporal [[META3:![0-9]+]], !llvm.access.group [[ACC_GRP2]]
2914 // CHECK29-NEXT: [[CONV:%.*]] = fptosi float [[TMP6]] to i32
2915 // CHECK29-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2916 // CHECK29-NEXT: [[TMP7:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
2917 // CHECK29-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP7]] to i64
2918 // CHECK29-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
2919 // CHECK29-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
2920 // CHECK29-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2921 // CHECK29: omp.body.continue:
2922 // CHECK29-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2923 // CHECK29: omp.inner.for.inc:
2924 // CHECK29-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2925 // CHECK29-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP8]], 1
2926 // CHECK29-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2927 // CHECK29-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
2928 // CHECK29: omp.inner.for.end:
2929 // CHECK29-NEXT: br label [[OMP_IF_END:%.*]]
2930 // CHECK29: omp_if.else:
2931 // CHECK29-NEXT: br label [[OMP_INNER_FOR_COND4:%.*]]
2932 // CHECK29: omp.inner.for.cond4:
2933 // CHECK29-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2934 // CHECK29-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2935 // CHECK29-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
2936 // CHECK29-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY6:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
2937 // CHECK29: omp.inner.for.body6:
2938 // CHECK29-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2939 // CHECK29-NEXT: [[MUL7:%.*]] = mul nsw i32 [[TMP11]], 1
2940 // CHECK29-NEXT: [[ADD8:%.*]] = add nsw i32 0, [[MUL7]]
2941 // CHECK29-NEXT: store i32 [[ADD8]], ptr [[I]], align 4
2942 // CHECK29-NEXT: [[B9:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
2943 // CHECK29-NEXT: [[TMP12:%.*]] = load float, ptr [[B9]], align 4
2944 // CHECK29-NEXT: [[CONV10:%.*]] = fptosi float [[TMP12]] to i32
2945 // CHECK29-NEXT: [[A11:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2946 // CHECK29-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
2947 // CHECK29-NEXT: [[IDXPROM12:%.*]] = sext i32 [[TMP13]] to i64
2948 // CHECK29-NEXT: [[ARRAYIDX13:%.*]] = getelementptr inbounds [123 x i32], ptr [[A11]], i64 0, i64 [[IDXPROM12]]
2949 // CHECK29-NEXT: store i32 [[CONV10]], ptr [[ARRAYIDX13]], align 4
2950 // CHECK29-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
2951 // CHECK29: omp.body.continue14:
2952 // CHECK29-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
2953 // CHECK29: omp.inner.for.inc15:
2954 // CHECK29-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2955 // CHECK29-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP14]], 1
2956 // CHECK29-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
2957 // CHECK29-NEXT: br label [[OMP_INNER_FOR_COND4]], !llvm.loop [[LOOP7:![0-9]+]]
2958 // CHECK29: omp.inner.for.end17:
2959 // CHECK29-NEXT: br label [[OMP_IF_END]]
2960 // CHECK29: omp_if.end:
2961 // CHECK29-NEXT: store i32 123, ptr [[I]], align 4
2962 // CHECK29-NEXT: [[A18:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2963 // CHECK29-NEXT: [[ARRAYIDX19:%.*]] = getelementptr inbounds [123 x i32], ptr [[A18]], i64 0, i64 0
2964 // CHECK29-NEXT: [[TMP15:%.*]] = load i32, ptr [[ARRAYIDX19]], align 4
2965 // CHECK29-NEXT: ret i32 [[TMP15]]
2968 // CHECK31-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2969 // CHECK31-SAME: () #[[ATTR0:[0-9]+]] {
2970 // CHECK31-NEXT: entry:
2971 // CHECK31-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2972 // CHECK31-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2973 // CHECK31-NEXT: ret i32 [[CALL]]
2976 // CHECK31-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2977 // CHECK31-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
2978 // CHECK31-NEXT: entry:
2979 // CHECK31-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2980 // CHECK31-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2981 // CHECK31-NEXT: [[TMP:%.*]] = alloca i32, align 4
2982 // CHECK31-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2983 // CHECK31-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2984 // CHECK31-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2985 // CHECK31-NEXT: [[I:%.*]] = alloca i32, align 4
2986 // CHECK31-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2987 // CHECK31-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2988 // CHECK31-NEXT: [[B:%.*]] = getelementptr inbounds nuw [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2989 // CHECK31-NEXT: [[TMP0:%.*]] = load float, ptr [[B]], align 4
2990 // CHECK31-NEXT: [[TOBOOL:%.*]] = fcmp une float [[TMP0]], 0.000000e+00
2991 // CHECK31-NEXT: [[STOREDV:%.*]] = zext i1 [[TOBOOL]] to i8
2992 // CHECK31-NEXT: store i8 [[STOREDV]], ptr [[DOTCAPTURE_EXPR_]], align 1
2993 // CHECK31-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2994 // CHECK31-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2995 // CHECK31-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2996 // CHECK31-NEXT: store i32 [[TMP1]], ptr [[DOTOMP_IV]], align 4
2997 // CHECK31-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2998 // CHECK31-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP2]] to i1
2999 // CHECK31-NEXT: br i1 [[LOADEDV]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
3000 // CHECK31: omp_if.then:
3001 // CHECK31-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3002 // CHECK31: omp.inner.for.cond:
3003 // CHECK31-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
3004 // CHECK31-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
3005 // CHECK31-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP3]], [[TMP4]]
3006 // CHECK31-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3007 // CHECK31: omp.inner.for.body:
3008 // CHECK31-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
3009 // CHECK31-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP5]], 1
3010 // CHECK31-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3011 // CHECK31-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP3]]
3012 // CHECK31-NEXT: [[B2:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
3013 // CHECK31-NEXT: [[TMP6:%.*]] = load float, ptr [[B2]], align 4, !nontemporal [[META4:![0-9]+]], !llvm.access.group [[ACC_GRP3]]
3014 // CHECK31-NEXT: [[CONV:%.*]] = fptosi float [[TMP6]] to i32
3015 // CHECK31-NEXT: [[A:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
3016 // CHECK31-NEXT: [[TMP7:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP3]]
3017 // CHECK31-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP7]]
3018 // CHECK31-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
3019 // CHECK31-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3020 // CHECK31: omp.body.continue:
3021 // CHECK31-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3022 // CHECK31: omp.inner.for.inc:
3023 // CHECK31-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
3024 // CHECK31-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP8]], 1
3025 // CHECK31-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
3026 // CHECK31-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP5:![0-9]+]]
3027 // CHECK31: omp.inner.for.end:
3028 // CHECK31-NEXT: br label [[OMP_IF_END:%.*]]
3029 // CHECK31: omp_if.else:
3030 // CHECK31-NEXT: br label [[OMP_INNER_FOR_COND4:%.*]]
3031 // CHECK31: omp.inner.for.cond4:
3032 // CHECK31-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3033 // CHECK31-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3034 // CHECK31-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
3035 // CHECK31-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY6:%.*]], label [[OMP_INNER_FOR_END16:%.*]]
3036 // CHECK31: omp.inner.for.body6:
3037 // CHECK31-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3038 // CHECK31-NEXT: [[MUL7:%.*]] = mul nsw i32 [[TMP11]], 1
3039 // CHECK31-NEXT: [[ADD8:%.*]] = add nsw i32 0, [[MUL7]]
3040 // CHECK31-NEXT: store i32 [[ADD8]], ptr [[I]], align 4
3041 // CHECK31-NEXT: [[B9:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
3042 // CHECK31-NEXT: [[TMP12:%.*]] = load float, ptr [[B9]], align 4
3043 // CHECK31-NEXT: [[CONV10:%.*]] = fptosi float [[TMP12]] to i32
3044 // CHECK31-NEXT: [[A11:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
3045 // CHECK31-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
3046 // CHECK31-NEXT: [[ARRAYIDX12:%.*]] = getelementptr inbounds [123 x i32], ptr [[A11]], i32 0, i32 [[TMP13]]
3047 // CHECK31-NEXT: store i32 [[CONV10]], ptr [[ARRAYIDX12]], align 4
3048 // CHECK31-NEXT: br label [[OMP_BODY_CONTINUE13:%.*]]
3049 // CHECK31: omp.body.continue13:
3050 // CHECK31-NEXT: br label [[OMP_INNER_FOR_INC14:%.*]]
3051 // CHECK31: omp.inner.for.inc14:
3052 // CHECK31-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3053 // CHECK31-NEXT: [[ADD15:%.*]] = add nsw i32 [[TMP14]], 1
3054 // CHECK31-NEXT: store i32 [[ADD15]], ptr [[DOTOMP_IV]], align 4
3055 // CHECK31-NEXT: br label [[OMP_INNER_FOR_COND4]], !llvm.loop [[LOOP8:![0-9]+]]
3056 // CHECK31: omp.inner.for.end16:
3057 // CHECK31-NEXT: br label [[OMP_IF_END]]
3058 // CHECK31: omp_if.end:
3059 // CHECK31-NEXT: store i32 123, ptr [[I]], align 4
3060 // CHECK31-NEXT: [[A17:%.*]] = getelementptr inbounds nuw [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
3061 // CHECK31-NEXT: [[ARRAYIDX18:%.*]] = getelementptr inbounds [123 x i32], ptr [[A17]], i32 0, i32 0
3062 // CHECK31-NEXT: [[TMP15:%.*]] = load i32, ptr [[ARRAYIDX18]], align 4
3063 // CHECK31-NEXT: ret i32 [[TMP15]]
3066 // CHECK33-LABEL: define {{[^@]+}}@main
3067 // CHECK33-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
3068 // CHECK33-NEXT: entry:
3069 // CHECK33-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3070 // CHECK33-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3071 // CHECK33-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
3072 // CHECK33-NEXT: [[N:%.*]] = alloca i32, align 4
3073 // CHECK33-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
3074 // CHECK33-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
3075 // CHECK33-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
3076 // CHECK33-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
3077 // CHECK33-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
3078 // CHECK33-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
3079 // CHECK33-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
3080 // CHECK33-NEXT: [[TMP:%.*]] = alloca i32, align 4
3081 // CHECK33-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3082 // CHECK33-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3083 // CHECK33-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3084 // CHECK33-NEXT: store i32 0, ptr [[RETVAL]], align 4
3085 // CHECK33-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3086 // CHECK33-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
3087 // CHECK33-NEXT: store i32 100, ptr [[N]], align 4
3088 // CHECK33-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
3089 // CHECK33-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
3090 // CHECK33-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
3091 // CHECK33-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
3092 // CHECK33-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
3093 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
3094 // CHECK33-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
3095 // CHECK33-NEXT: store i32 [[TMP3]], ptr [[N_CASTED]], align 4
3096 // CHECK33-NEXT: [[TMP4:%.*]] = load i64, ptr [[N_CASTED]], align 8
3097 // CHECK33-NEXT: [[TMP5:%.*]] = mul nuw i64 [[TMP1]], 4
3098 // CHECK33-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
3099 // CHECK33-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3100 // CHECK33-NEXT: store i64 [[TMP4]], ptr [[TMP6]], align 8
3101 // CHECK33-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3102 // CHECK33-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
3103 // CHECK33-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
3104 // CHECK33-NEXT: store ptr null, ptr [[TMP8]], align 8
3105 // CHECK33-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3106 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[TMP9]], align 8
3107 // CHECK33-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3108 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[TMP10]], align 8
3109 // CHECK33-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
3110 // CHECK33-NEXT: store ptr null, ptr [[TMP11]], align 8
3111 // CHECK33-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3112 // CHECK33-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 8
3113 // CHECK33-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3114 // CHECK33-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 8
3115 // CHECK33-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
3116 // CHECK33-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 8
3117 // CHECK33-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
3118 // CHECK33-NEXT: store ptr null, ptr [[TMP15]], align 8
3119 // CHECK33-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3120 // CHECK33-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3121 // CHECK33-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
3122 // CHECK33-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
3123 // CHECK33-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
3124 // CHECK33-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3125 // CHECK33-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
3126 // CHECK33-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3127 // CHECK33-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3128 // CHECK33-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3129 // CHECK33-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3130 // CHECK33-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
3131 // CHECK33-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
3132 // CHECK33-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3133 // CHECK33-NEXT: store i32 3, ptr [[TMP23]], align 4
3134 // CHECK33-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3135 // CHECK33-NEXT: store i32 3, ptr [[TMP24]], align 4
3136 // CHECK33-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3137 // CHECK33-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 8
3138 // CHECK33-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3139 // CHECK33-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 8
3140 // CHECK33-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3141 // CHECK33-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 8
3142 // CHECK33-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3143 // CHECK33-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 8
3144 // CHECK33-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3145 // CHECK33-NEXT: store ptr null, ptr [[TMP29]], align 8
3146 // CHECK33-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3147 // CHECK33-NEXT: store ptr null, ptr [[TMP30]], align 8
3148 // CHECK33-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3149 // CHECK33-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
3150 // CHECK33-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3151 // CHECK33-NEXT: store i64 0, ptr [[TMP32]], align 8
3152 // CHECK33-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3153 // CHECK33-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
3154 // CHECK33-NEXT: [[TMP34:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3155 // CHECK33-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP34]], align 4
3156 // CHECK33-NEXT: [[TMP35:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3157 // CHECK33-NEXT: store i32 0, ptr [[TMP35]], align 4
3158 // CHECK33-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.region_id, ptr [[KERNEL_ARGS]])
3159 // CHECK33-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
3160 // CHECK33-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3161 // CHECK33: omp_offload.failed:
3162 // CHECK33-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192(i64 [[TMP4]], i64 [[TMP1]], ptr [[VLA]]) #[[ATTR3:[0-9]+]]
3163 // CHECK33-NEXT: br label [[OMP_OFFLOAD_CONT]]
3164 // CHECK33: omp_offload.cont:
3165 // CHECK33-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
3166 // CHECK33-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP38]])
3167 // CHECK33-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
3168 // CHECK33-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
3169 // CHECK33-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
3170 // CHECK33-NEXT: [[TMP40:%.*]] = load i32, ptr [[RETVAL]], align 4
3171 // CHECK33-NEXT: ret i32 [[TMP40]]
3174 // CHECK33-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192
3175 // CHECK33-SAME: (i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
3176 // CHECK33-NEXT: entry:
3177 // CHECK33-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
3178 // CHECK33-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
3179 // CHECK33-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
3180 // CHECK33-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
3181 // CHECK33-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
3182 // CHECK33-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
3183 // CHECK33-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
3184 // CHECK33-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
3185 // CHECK33-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined, ptr [[N_ADDR]], i64 [[TMP0]], ptr [[TMP1]])
3186 // CHECK33-NEXT: ret void
3189 // CHECK33-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined
3190 // CHECK33-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] {
3191 // CHECK33-NEXT: entry:
3192 // CHECK33-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3193 // CHECK33-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3194 // CHECK33-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
3195 // CHECK33-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
3196 // CHECK33-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
3197 // CHECK33-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3198 // CHECK33-NEXT: [[TMP:%.*]] = alloca i32, align 4
3199 // CHECK33-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3200 // CHECK33-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3201 // CHECK33-NEXT: [[I:%.*]] = alloca i32, align 4
3202 // CHECK33-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3203 // CHECK33-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3204 // CHECK33-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3205 // CHECK33-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3206 // CHECK33-NEXT: [[I3:%.*]] = alloca i32, align 4
3207 // CHECK33-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3208 // CHECK33-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3209 // CHECK33-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
3210 // CHECK33-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
3211 // CHECK33-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
3212 // CHECK33-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
3213 // CHECK33-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
3214 // CHECK33-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
3215 // CHECK33-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
3216 // CHECK33-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
3217 // CHECK33-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3218 // CHECK33-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
3219 // CHECK33-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3220 // CHECK33-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3221 // CHECK33-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3222 // CHECK33-NEXT: store i32 0, ptr [[I]], align 4
3223 // CHECK33-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3224 // CHECK33-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
3225 // CHECK33-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
3226 // CHECK33: omp.precond.then:
3227 // CHECK33-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3228 // CHECK33-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3229 // CHECK33-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
3230 // CHECK33-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3231 // CHECK33-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3232 // CHECK33-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3233 // CHECK33-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
3234 // CHECK33-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3235 // CHECK33-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3236 // CHECK33-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3237 // CHECK33-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
3238 // CHECK33-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3239 // CHECK33: cond.true:
3240 // CHECK33-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3241 // CHECK33-NEXT: br label [[COND_END:%.*]]
3242 // CHECK33: cond.false:
3243 // CHECK33-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3244 // CHECK33-NEXT: br label [[COND_END]]
3245 // CHECK33: cond.end:
3246 // CHECK33-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
3247 // CHECK33-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3248 // CHECK33-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3249 // CHECK33-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
3250 // CHECK33-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3251 // CHECK33: omp.inner.for.cond:
3252 // CHECK33-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
3253 // CHECK33-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
3254 // CHECK33-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
3255 // CHECK33-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3256 // CHECK33: omp.inner.for.body:
3257 // CHECK33-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
3258 // CHECK33-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
3259 // CHECK33-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3260 // CHECK33-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP5]]
3261 // CHECK33-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP5]]
3262 // CHECK33-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
3263 // CHECK33-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
3264 // CHECK33-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
3265 // CHECK33-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3266 // CHECK33: omp.body.continue:
3267 // CHECK33-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3268 // CHECK33: omp.inner.for.inc:
3269 // CHECK33-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
3270 // CHECK33-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
3271 // CHECK33-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
3272 // CHECK33-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
3273 // CHECK33: omp.inner.for.end:
3274 // CHECK33-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3275 // CHECK33: omp.loop.exit:
3276 // CHECK33-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3277 // CHECK33-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
3278 // CHECK33-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
3279 // CHECK33-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3280 // CHECK33-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
3281 // CHECK33-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3282 // CHECK33: .omp.final.then:
3283 // CHECK33-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3284 // CHECK33-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP23]], 0
3285 // CHECK33-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
3286 // CHECK33-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
3287 // CHECK33-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
3288 // CHECK33-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
3289 // CHECK33-NEXT: br label [[DOTOMP_FINAL_DONE]]
3290 // CHECK33: .omp.final.done:
3291 // CHECK33-NEXT: br label [[OMP_PRECOND_END]]
3292 // CHECK33: omp.precond.end:
3293 // CHECK33-NEXT: ret void
3296 // CHECK33-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
3297 // CHECK33-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat {
3298 // CHECK33-NEXT: entry:
3299 // CHECK33-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3300 // CHECK33-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
3301 // CHECK33-NEXT: [[TE:%.*]] = alloca i32, align 4
3302 // CHECK33-NEXT: [[TH:%.*]] = alloca i32, align 4
3303 // CHECK33-NEXT: [[TE_CASTED:%.*]] = alloca i64, align 8
3304 // CHECK33-NEXT: [[TH_CASTED:%.*]] = alloca i64, align 8
3305 // CHECK33-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
3306 // CHECK33-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
3307 // CHECK33-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
3308 // CHECK33-NEXT: [[TMP:%.*]] = alloca i32, align 4
3309 // CHECK33-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3310 // CHECK33-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3311 // CHECK33-NEXT: store i32 0, ptr [[TE]], align 4
3312 // CHECK33-NEXT: store i32 128, ptr [[TH]], align 4
3313 // CHECK33-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
3314 // CHECK33-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
3315 // CHECK33-NEXT: [[TMP1:%.*]] = load i64, ptr [[TE_CASTED]], align 8
3316 // CHECK33-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
3317 // CHECK33-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
3318 // CHECK33-NEXT: [[TMP3:%.*]] = load i64, ptr [[TH_CASTED]], align 8
3319 // CHECK33-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3320 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[TMP4]], align 8
3321 // CHECK33-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3322 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[TMP5]], align 8
3323 // CHECK33-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
3324 // CHECK33-NEXT: store ptr null, ptr [[TMP6]], align 8
3325 // CHECK33-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3326 // CHECK33-NEXT: store i64 [[TMP3]], ptr [[TMP7]], align 8
3327 // CHECK33-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3328 // CHECK33-NEXT: store i64 [[TMP3]], ptr [[TMP8]], align 8
3329 // CHECK33-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
3330 // CHECK33-NEXT: store ptr null, ptr [[TMP9]], align 8
3331 // CHECK33-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3332 // CHECK33-NEXT: store ptr [[A]], ptr [[TMP10]], align 8
3333 // CHECK33-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3334 // CHECK33-NEXT: store ptr [[A]], ptr [[TMP11]], align 8
3335 // CHECK33-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
3336 // CHECK33-NEXT: store ptr null, ptr [[TMP12]], align 8
3337 // CHECK33-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3338 // CHECK33-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3339 // CHECK33-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
3340 // CHECK33-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
3341 // CHECK33-NEXT: [[TMP17:%.*]] = icmp ult i32 [[TMP16]], 1
3342 // CHECK33-NEXT: [[TMP18:%.*]] = select i1 [[TMP17]], i32 [[TMP16]], i32 1
3343 // CHECK33-NEXT: [[TMP19:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
3344 // CHECK33-NEXT: [[TMP20:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP18]], 0
3345 // CHECK33-NEXT: [[TMP21:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3346 // CHECK33-NEXT: store i32 3, ptr [[TMP21]], align 4
3347 // CHECK33-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3348 // CHECK33-NEXT: store i32 3, ptr [[TMP22]], align 4
3349 // CHECK33-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3350 // CHECK33-NEXT: store ptr [[TMP13]], ptr [[TMP23]], align 8
3351 // CHECK33-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3352 // CHECK33-NEXT: store ptr [[TMP14]], ptr [[TMP24]], align 8
3353 // CHECK33-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3354 // CHECK33-NEXT: store ptr @.offload_sizes.1, ptr [[TMP25]], align 8
3355 // CHECK33-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3356 // CHECK33-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP26]], align 8
3357 // CHECK33-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3358 // CHECK33-NEXT: store ptr null, ptr [[TMP27]], align 8
3359 // CHECK33-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3360 // CHECK33-NEXT: store ptr null, ptr [[TMP28]], align 8
3361 // CHECK33-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3362 // CHECK33-NEXT: store i64 10, ptr [[TMP29]], align 8
3363 // CHECK33-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3364 // CHECK33-NEXT: store i64 0, ptr [[TMP30]], align 8
3365 // CHECK33-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3366 // CHECK33-NEXT: store [3 x i32] [[TMP19]], ptr [[TMP31]], align 4
3367 // CHECK33-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3368 // CHECK33-NEXT: store [3 x i32] [[TMP20]], ptr [[TMP32]], align 4
3369 // CHECK33-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3370 // CHECK33-NEXT: store i32 0, ptr [[TMP33]], align 4
3371 // CHECK33-NEXT: [[TMP34:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 [[TMP15]], i32 [[TMP18]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.region_id, ptr [[KERNEL_ARGS]])
3372 // CHECK33-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
3373 // CHECK33-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3374 // CHECK33: omp_offload.failed:
3375 // CHECK33-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181(i64 [[TMP1]], i64 [[TMP3]], ptr [[A]]) #[[ATTR3]]
3376 // CHECK33-NEXT: br label [[OMP_OFFLOAD_CONT]]
3377 // CHECK33: omp_offload.cont:
3378 // CHECK33-NEXT: ret i32 0
3381 // CHECK33-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181
3382 // CHECK33-SAME: (i64 noundef [[TE:%.*]], i64 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
3383 // CHECK33-NEXT: entry:
3384 // CHECK33-NEXT: [[TE_ADDR:%.*]] = alloca i64, align 8
3385 // CHECK33-NEXT: [[TH_ADDR:%.*]] = alloca i64, align 8
3386 // CHECK33-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
3387 // CHECK33-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
3388 // CHECK33-NEXT: store i64 [[TE]], ptr [[TE_ADDR]], align 8
3389 // CHECK33-NEXT: store i64 [[TH]], ptr [[TH_ADDR]], align 8
3390 // CHECK33-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
3391 // CHECK33-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
3392 // CHECK33-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
3393 // CHECK33-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
3394 // CHECK33-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
3395 // CHECK33-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined, ptr [[TMP1]])
3396 // CHECK33-NEXT: ret void
3399 // CHECK33-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined
3400 // CHECK33-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
3401 // CHECK33-NEXT: entry:
3402 // CHECK33-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3403 // CHECK33-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3404 // CHECK33-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
3405 // CHECK33-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3406 // CHECK33-NEXT: [[TMP:%.*]] = alloca i32, align 4
3407 // CHECK33-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3408 // CHECK33-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3409 // CHECK33-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3410 // CHECK33-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3411 // CHECK33-NEXT: [[I:%.*]] = alloca i32, align 4
3412 // CHECK33-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3413 // CHECK33-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3414 // CHECK33-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
3415 // CHECK33-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
3416 // CHECK33-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3417 // CHECK33-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
3418 // CHECK33-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3419 // CHECK33-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3420 // CHECK33-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3421 // CHECK33-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
3422 // CHECK33-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3423 // CHECK33-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3424 // CHECK33-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
3425 // CHECK33-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3426 // CHECK33: cond.true:
3427 // CHECK33-NEXT: br label [[COND_END:%.*]]
3428 // CHECK33: cond.false:
3429 // CHECK33-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3430 // CHECK33-NEXT: br label [[COND_END]]
3431 // CHECK33: cond.end:
3432 // CHECK33-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
3433 // CHECK33-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3434 // CHECK33-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3435 // CHECK33-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
3436 // CHECK33-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3437 // CHECK33: omp.inner.for.cond:
3438 // CHECK33-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
3439 // CHECK33-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
3440 // CHECK33-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3441 // CHECK33-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3442 // CHECK33: omp.inner.for.body:
3443 // CHECK33-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
3444 // CHECK33-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
3445 // CHECK33-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3446 // CHECK33-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP11]]
3447 // CHECK33-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP11]]
3448 // CHECK33-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
3449 // CHECK33-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i64 0, i64 [[IDXPROM]]
3450 // CHECK33-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP11]]
3451 // CHECK33-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3452 // CHECK33: omp.body.continue:
3453 // CHECK33-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3454 // CHECK33: omp.inner.for.inc:
3455 // CHECK33-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
3456 // CHECK33-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
3457 // CHECK33-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
3458 // CHECK33-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
3459 // CHECK33: omp.inner.for.end:
3460 // CHECK33-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3461 // CHECK33: omp.loop.exit:
3462 // CHECK33-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
3463 // CHECK33-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3464 // CHECK33-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3465 // CHECK33-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3466 // CHECK33: .omp.final.then:
3467 // CHECK33-NEXT: store i32 10, ptr [[I]], align 4
3468 // CHECK33-NEXT: br label [[DOTOMP_FINAL_DONE]]
3469 // CHECK33: .omp.final.done:
3470 // CHECK33-NEXT: ret void
3473 // CHECK35-LABEL: define {{[^@]+}}@main
3474 // CHECK35-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
3475 // CHECK35-NEXT: entry:
3476 // CHECK35-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3477 // CHECK35-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3478 // CHECK35-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
3479 // CHECK35-NEXT: [[N:%.*]] = alloca i32, align 4
3480 // CHECK35-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
3481 // CHECK35-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
3482 // CHECK35-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
3483 // CHECK35-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
3484 // CHECK35-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
3485 // CHECK35-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
3486 // CHECK35-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
3487 // CHECK35-NEXT: [[TMP:%.*]] = alloca i32, align 4
3488 // CHECK35-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3489 // CHECK35-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3490 // CHECK35-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3491 // CHECK35-NEXT: store i32 0, ptr [[RETVAL]], align 4
3492 // CHECK35-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3493 // CHECK35-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
3494 // CHECK35-NEXT: store i32 100, ptr [[N]], align 4
3495 // CHECK35-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
3496 // CHECK35-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
3497 // CHECK35-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
3498 // CHECK35-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
3499 // CHECK35-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
3500 // CHECK35-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
3501 // CHECK35-NEXT: store i32 [[TMP2]], ptr [[N_CASTED]], align 4
3502 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[N_CASTED]], align 4
3503 // CHECK35-NEXT: [[TMP4:%.*]] = mul nuw i32 [[TMP0]], 4
3504 // CHECK35-NEXT: [[TMP5:%.*]] = sext i32 [[TMP4]] to i64
3505 // CHECK35-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
3506 // CHECK35-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3507 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[TMP6]], align 4
3508 // CHECK35-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3509 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
3510 // CHECK35-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
3511 // CHECK35-NEXT: store ptr null, ptr [[TMP8]], align 4
3512 // CHECK35-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3513 // CHECK35-NEXT: store i32 [[TMP0]], ptr [[TMP9]], align 4
3514 // CHECK35-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3515 // CHECK35-NEXT: store i32 [[TMP0]], ptr [[TMP10]], align 4
3516 // CHECK35-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
3517 // CHECK35-NEXT: store ptr null, ptr [[TMP11]], align 4
3518 // CHECK35-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3519 // CHECK35-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 4
3520 // CHECK35-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3521 // CHECK35-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 4
3522 // CHECK35-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
3523 // CHECK35-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 4
3524 // CHECK35-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
3525 // CHECK35-NEXT: store ptr null, ptr [[TMP15]], align 4
3526 // CHECK35-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3527 // CHECK35-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3528 // CHECK35-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
3529 // CHECK35-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
3530 // CHECK35-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
3531 // CHECK35-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3532 // CHECK35-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
3533 // CHECK35-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3534 // CHECK35-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3535 // CHECK35-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3536 // CHECK35-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3537 // CHECK35-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
3538 // CHECK35-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
3539 // CHECK35-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3540 // CHECK35-NEXT: store i32 3, ptr [[TMP23]], align 4
3541 // CHECK35-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3542 // CHECK35-NEXT: store i32 3, ptr [[TMP24]], align 4
3543 // CHECK35-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3544 // CHECK35-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 4
3545 // CHECK35-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3546 // CHECK35-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 4
3547 // CHECK35-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3548 // CHECK35-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 4
3549 // CHECK35-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3550 // CHECK35-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 4
3551 // CHECK35-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3552 // CHECK35-NEXT: store ptr null, ptr [[TMP29]], align 4
3553 // CHECK35-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3554 // CHECK35-NEXT: store ptr null, ptr [[TMP30]], align 4
3555 // CHECK35-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3556 // CHECK35-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
3557 // CHECK35-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3558 // CHECK35-NEXT: store i64 0, ptr [[TMP32]], align 8
3559 // CHECK35-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3560 // CHECK35-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
3561 // CHECK35-NEXT: [[TMP34:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3562 // CHECK35-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP34]], align 4
3563 // CHECK35-NEXT: [[TMP35:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3564 // CHECK35-NEXT: store i32 0, ptr [[TMP35]], align 4
3565 // CHECK35-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.region_id, ptr [[KERNEL_ARGS]])
3566 // CHECK35-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
3567 // CHECK35-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3568 // CHECK35: omp_offload.failed:
3569 // CHECK35-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192(i32 [[TMP3]], i32 [[TMP0]], ptr [[VLA]]) #[[ATTR3:[0-9]+]]
3570 // CHECK35-NEXT: br label [[OMP_OFFLOAD_CONT]]
3571 // CHECK35: omp_offload.cont:
3572 // CHECK35-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
3573 // CHECK35-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP38]])
3574 // CHECK35-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
3575 // CHECK35-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
3576 // CHECK35-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
3577 // CHECK35-NEXT: [[TMP40:%.*]] = load i32, ptr [[RETVAL]], align 4
3578 // CHECK35-NEXT: ret i32 [[TMP40]]
3581 // CHECK35-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192
3582 // CHECK35-SAME: (i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
3583 // CHECK35-NEXT: entry:
3584 // CHECK35-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
3585 // CHECK35-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
3586 // CHECK35-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3587 // CHECK35-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
3588 // CHECK35-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
3589 // CHECK35-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3590 // CHECK35-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
3591 // CHECK35-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3592 // CHECK35-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined, ptr [[N_ADDR]], i32 [[TMP0]], ptr [[TMP1]])
3593 // CHECK35-NEXT: ret void
3596 // CHECK35-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined
3597 // CHECK35-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] {
3598 // CHECK35-NEXT: entry:
3599 // CHECK35-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3600 // CHECK35-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3601 // CHECK35-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
3602 // CHECK35-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
3603 // CHECK35-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3604 // CHECK35-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3605 // CHECK35-NEXT: [[TMP:%.*]] = alloca i32, align 4
3606 // CHECK35-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3607 // CHECK35-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3608 // CHECK35-NEXT: [[I:%.*]] = alloca i32, align 4
3609 // CHECK35-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3610 // CHECK35-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3611 // CHECK35-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3612 // CHECK35-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3613 // CHECK35-NEXT: [[I3:%.*]] = alloca i32, align 4
3614 // CHECK35-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3615 // CHECK35-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3616 // CHECK35-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
3617 // CHECK35-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
3618 // CHECK35-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3619 // CHECK35-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
3620 // CHECK35-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
3621 // CHECK35-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3622 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
3623 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
3624 // CHECK35-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3625 // CHECK35-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
3626 // CHECK35-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3627 // CHECK35-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3628 // CHECK35-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3629 // CHECK35-NEXT: store i32 0, ptr [[I]], align 4
3630 // CHECK35-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3631 // CHECK35-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
3632 // CHECK35-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
3633 // CHECK35: omp.precond.then:
3634 // CHECK35-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3635 // CHECK35-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3636 // CHECK35-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
3637 // CHECK35-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3638 // CHECK35-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3639 // CHECK35-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3640 // CHECK35-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
3641 // CHECK35-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3642 // CHECK35-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3643 // CHECK35-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3644 // CHECK35-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
3645 // CHECK35-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3646 // CHECK35: cond.true:
3647 // CHECK35-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3648 // CHECK35-NEXT: br label [[COND_END:%.*]]
3649 // CHECK35: cond.false:
3650 // CHECK35-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3651 // CHECK35-NEXT: br label [[COND_END]]
3652 // CHECK35: cond.end:
3653 // CHECK35-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
3654 // CHECK35-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3655 // CHECK35-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3656 // CHECK35-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
3657 // CHECK35-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3658 // CHECK35: omp.inner.for.cond:
3659 // CHECK35-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
3660 // CHECK35-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP6]]
3661 // CHECK35-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
3662 // CHECK35-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3663 // CHECK35: omp.inner.for.body:
3664 // CHECK35-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
3665 // CHECK35-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
3666 // CHECK35-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3667 // CHECK35-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP6]]
3668 // CHECK35-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP6]]
3669 // CHECK35-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP17]]
3670 // CHECK35-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP6]]
3671 // CHECK35-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3672 // CHECK35: omp.body.continue:
3673 // CHECK35-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3674 // CHECK35: omp.inner.for.inc:
3675 // CHECK35-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
3676 // CHECK35-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
3677 // CHECK35-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
3678 // CHECK35-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
3679 // CHECK35: omp.inner.for.end:
3680 // CHECK35-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3681 // CHECK35: omp.loop.exit:
3682 // CHECK35-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3683 // CHECK35-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
3684 // CHECK35-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
3685 // CHECK35-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3686 // CHECK35-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
3687 // CHECK35-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3688 // CHECK35: .omp.final.then:
3689 // CHECK35-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3690 // CHECK35-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP23]], 0
3691 // CHECK35-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
3692 // CHECK35-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
3693 // CHECK35-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
3694 // CHECK35-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
3695 // CHECK35-NEXT: br label [[DOTOMP_FINAL_DONE]]
3696 // CHECK35: .omp.final.done:
3697 // CHECK35-NEXT: br label [[OMP_PRECOND_END]]
3698 // CHECK35: omp.precond.end:
3699 // CHECK35-NEXT: ret void
3702 // CHECK35-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
3703 // CHECK35-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat {
3704 // CHECK35-NEXT: entry:
3705 // CHECK35-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3706 // CHECK35-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
3707 // CHECK35-NEXT: [[TE:%.*]] = alloca i32, align 4
3708 // CHECK35-NEXT: [[TH:%.*]] = alloca i32, align 4
3709 // CHECK35-NEXT: [[TE_CASTED:%.*]] = alloca i32, align 4
3710 // CHECK35-NEXT: [[TH_CASTED:%.*]] = alloca i32, align 4
3711 // CHECK35-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
3712 // CHECK35-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
3713 // CHECK35-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
3714 // CHECK35-NEXT: [[TMP:%.*]] = alloca i32, align 4
3715 // CHECK35-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3716 // CHECK35-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3717 // CHECK35-NEXT: store i32 0, ptr [[TE]], align 4
3718 // CHECK35-NEXT: store i32 128, ptr [[TH]], align 4
3719 // CHECK35-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
3720 // CHECK35-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
3721 // CHECK35-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE_CASTED]], align 4
3722 // CHECK35-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
3723 // CHECK35-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
3724 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_CASTED]], align 4
3725 // CHECK35-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3726 // CHECK35-NEXT: store i32 [[TMP1]], ptr [[TMP4]], align 4
3727 // CHECK35-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3728 // CHECK35-NEXT: store i32 [[TMP1]], ptr [[TMP5]], align 4
3729 // CHECK35-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
3730 // CHECK35-NEXT: store ptr null, ptr [[TMP6]], align 4
3731 // CHECK35-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3732 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
3733 // CHECK35-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3734 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[TMP8]], align 4
3735 // CHECK35-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
3736 // CHECK35-NEXT: store ptr null, ptr [[TMP9]], align 4
3737 // CHECK35-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3738 // CHECK35-NEXT: store ptr [[A]], ptr [[TMP10]], align 4
3739 // CHECK35-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3740 // CHECK35-NEXT: store ptr [[A]], ptr [[TMP11]], align 4
3741 // CHECK35-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
3742 // CHECK35-NEXT: store ptr null, ptr [[TMP12]], align 4
3743 // CHECK35-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3744 // CHECK35-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3745 // CHECK35-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
3746 // CHECK35-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
3747 // CHECK35-NEXT: [[TMP17:%.*]] = icmp ult i32 [[TMP16]], 1
3748 // CHECK35-NEXT: [[TMP18:%.*]] = select i1 [[TMP17]], i32 [[TMP16]], i32 1
3749 // CHECK35-NEXT: [[TMP19:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
3750 // CHECK35-NEXT: [[TMP20:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP18]], 0
3751 // CHECK35-NEXT: [[TMP21:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3752 // CHECK35-NEXT: store i32 3, ptr [[TMP21]], align 4
3753 // CHECK35-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3754 // CHECK35-NEXT: store i32 3, ptr [[TMP22]], align 4
3755 // CHECK35-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3756 // CHECK35-NEXT: store ptr [[TMP13]], ptr [[TMP23]], align 4
3757 // CHECK35-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3758 // CHECK35-NEXT: store ptr [[TMP14]], ptr [[TMP24]], align 4
3759 // CHECK35-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3760 // CHECK35-NEXT: store ptr @.offload_sizes.1, ptr [[TMP25]], align 4
3761 // CHECK35-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3762 // CHECK35-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP26]], align 4
3763 // CHECK35-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3764 // CHECK35-NEXT: store ptr null, ptr [[TMP27]], align 4
3765 // CHECK35-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3766 // CHECK35-NEXT: store ptr null, ptr [[TMP28]], align 4
3767 // CHECK35-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3768 // CHECK35-NEXT: store i64 10, ptr [[TMP29]], align 8
3769 // CHECK35-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3770 // CHECK35-NEXT: store i64 0, ptr [[TMP30]], align 8
3771 // CHECK35-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3772 // CHECK35-NEXT: store [3 x i32] [[TMP19]], ptr [[TMP31]], align 4
3773 // CHECK35-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3774 // CHECK35-NEXT: store [3 x i32] [[TMP20]], ptr [[TMP32]], align 4
3775 // CHECK35-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3776 // CHECK35-NEXT: store i32 0, ptr [[TMP33]], align 4
3777 // CHECK35-NEXT: [[TMP34:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 [[TMP15]], i32 [[TMP18]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.region_id, ptr [[KERNEL_ARGS]])
3778 // CHECK35-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
3779 // CHECK35-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3780 // CHECK35: omp_offload.failed:
3781 // CHECK35-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181(i32 [[TMP1]], i32 [[TMP3]], ptr [[A]]) #[[ATTR3]]
3782 // CHECK35-NEXT: br label [[OMP_OFFLOAD_CONT]]
3783 // CHECK35: omp_offload.cont:
3784 // CHECK35-NEXT: ret i32 0
3787 // CHECK35-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181
3788 // CHECK35-SAME: (i32 noundef [[TE:%.*]], i32 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
3789 // CHECK35-NEXT: entry:
3790 // CHECK35-NEXT: [[TE_ADDR:%.*]] = alloca i32, align 4
3791 // CHECK35-NEXT: [[TH_ADDR:%.*]] = alloca i32, align 4
3792 // CHECK35-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3793 // CHECK35-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
3794 // CHECK35-NEXT: store i32 [[TE]], ptr [[TE_ADDR]], align 4
3795 // CHECK35-NEXT: store i32 [[TH]], ptr [[TH_ADDR]], align 4
3796 // CHECK35-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3797 // CHECK35-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3798 // CHECK35-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
3799 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
3800 // CHECK35-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
3801 // CHECK35-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined, ptr [[TMP1]])
3802 // CHECK35-NEXT: ret void
3805 // CHECK35-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined
3806 // CHECK35-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
3807 // CHECK35-NEXT: entry:
3808 // CHECK35-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3809 // CHECK35-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3810 // CHECK35-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3811 // CHECK35-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3812 // CHECK35-NEXT: [[TMP:%.*]] = alloca i32, align 4
3813 // CHECK35-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3814 // CHECK35-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3815 // CHECK35-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3816 // CHECK35-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3817 // CHECK35-NEXT: [[I:%.*]] = alloca i32, align 4
3818 // CHECK35-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3819 // CHECK35-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3820 // CHECK35-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3821 // CHECK35-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3822 // CHECK35-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3823 // CHECK35-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
3824 // CHECK35-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3825 // CHECK35-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3826 // CHECK35-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3827 // CHECK35-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
3828 // CHECK35-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3829 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3830 // CHECK35-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
3831 // CHECK35-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3832 // CHECK35: cond.true:
3833 // CHECK35-NEXT: br label [[COND_END:%.*]]
3834 // CHECK35: cond.false:
3835 // CHECK35-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3836 // CHECK35-NEXT: br label [[COND_END]]
3837 // CHECK35: cond.end:
3838 // CHECK35-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
3839 // CHECK35-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3840 // CHECK35-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3841 // CHECK35-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
3842 // CHECK35-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3843 // CHECK35: omp.inner.for.cond:
3844 // CHECK35-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12:![0-9]+]]
3845 // CHECK35-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP12]]
3846 // CHECK35-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3847 // CHECK35-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3848 // CHECK35: omp.inner.for.body:
3849 // CHECK35-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12]]
3850 // CHECK35-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
3851 // CHECK35-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3852 // CHECK35-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP12]]
3853 // CHECK35-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP12]]
3854 // CHECK35-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i32 0, i32 [[TMP9]]
3855 // CHECK35-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP12]]
3856 // CHECK35-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3857 // CHECK35: omp.body.continue:
3858 // CHECK35-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3859 // CHECK35: omp.inner.for.inc:
3860 // CHECK35-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12]]
3861 // CHECK35-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
3862 // CHECK35-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12]]
3863 // CHECK35-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP13:![0-9]+]]
3864 // CHECK35: omp.inner.for.end:
3865 // CHECK35-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3866 // CHECK35: omp.loop.exit:
3867 // CHECK35-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
3868 // CHECK35-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3869 // CHECK35-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3870 // CHECK35-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3871 // CHECK35: .omp.final.then:
3872 // CHECK35-NEXT: store i32 10, ptr [[I]], align 4
3873 // CHECK35-NEXT: br label [[DOTOMP_FINAL_DONE]]
3874 // CHECK35: .omp.final.done:
3875 // CHECK35-NEXT: ret void
3878 // CHECK37-LABEL: define {{[^@]+}}@main
3879 // CHECK37-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
3880 // CHECK37-NEXT: entry:
3881 // CHECK37-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3882 // CHECK37-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3883 // CHECK37-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
3884 // CHECK37-NEXT: [[N:%.*]] = alloca i32, align 4
3885 // CHECK37-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
3886 // CHECK37-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
3887 // CHECK37-NEXT: [[ARGC_CASTED:%.*]] = alloca i64, align 8
3888 // CHECK37-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
3889 // CHECK37-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 8
3890 // CHECK37-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 8
3891 // CHECK37-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 8
3892 // CHECK37-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [4 x i64], align 8
3893 // CHECK37-NEXT: [[TMP:%.*]] = alloca i32, align 4
3894 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3895 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3896 // CHECK37-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3897 // CHECK37-NEXT: store i32 0, ptr [[RETVAL]], align 4
3898 // CHECK37-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3899 // CHECK37-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
3900 // CHECK37-NEXT: store i32 100, ptr [[N]], align 4
3901 // CHECK37-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
3902 // CHECK37-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
3903 // CHECK37-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
3904 // CHECK37-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
3905 // CHECK37-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
3906 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
3907 // CHECK37-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
3908 // CHECK37-NEXT: store i32 [[TMP3]], ptr [[ARGC_CASTED]], align 4
3909 // CHECK37-NEXT: [[TMP4:%.*]] = load i64, ptr [[ARGC_CASTED]], align 8
3910 // CHECK37-NEXT: [[TMP5:%.*]] = load i32, ptr [[N]], align 4
3911 // CHECK37-NEXT: store i32 [[TMP5]], ptr [[N_CASTED]], align 4
3912 // CHECK37-NEXT: [[TMP6:%.*]] = load i64, ptr [[N_CASTED]], align 8
3913 // CHECK37-NEXT: [[TMP7:%.*]] = mul nuw i64 [[TMP1]], 4
3914 // CHECK37-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 32, i1 false)
3915 // CHECK37-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3916 // CHECK37-NEXT: store i64 [[TMP4]], ptr [[TMP8]], align 8
3917 // CHECK37-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3918 // CHECK37-NEXT: store i64 [[TMP4]], ptr [[TMP9]], align 8
3919 // CHECK37-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
3920 // CHECK37-NEXT: store ptr null, ptr [[TMP10]], align 8
3921 // CHECK37-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3922 // CHECK37-NEXT: store i64 [[TMP6]], ptr [[TMP11]], align 8
3923 // CHECK37-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3924 // CHECK37-NEXT: store i64 [[TMP6]], ptr [[TMP12]], align 8
3925 // CHECK37-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
3926 // CHECK37-NEXT: store ptr null, ptr [[TMP13]], align 8
3927 // CHECK37-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3928 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[TMP14]], align 8
3929 // CHECK37-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3930 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[TMP15]], align 8
3931 // CHECK37-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
3932 // CHECK37-NEXT: store ptr null, ptr [[TMP16]], align 8
3933 // CHECK37-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
3934 // CHECK37-NEXT: store ptr [[VLA]], ptr [[TMP17]], align 8
3935 // CHECK37-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
3936 // CHECK37-NEXT: store ptr [[VLA]], ptr [[TMP18]], align 8
3937 // CHECK37-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 3
3938 // CHECK37-NEXT: store i64 [[TMP7]], ptr [[TMP19]], align 8
3939 // CHECK37-NEXT: [[TMP20:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 3
3940 // CHECK37-NEXT: store ptr null, ptr [[TMP20]], align 8
3941 // CHECK37-NEXT: [[TMP21:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3942 // CHECK37-NEXT: [[TMP22:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3943 // CHECK37-NEXT: [[TMP23:%.*]] = getelementptr inbounds [4 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
3944 // CHECK37-NEXT: [[TMP24:%.*]] = load i32, ptr [[N]], align 4
3945 // CHECK37-NEXT: store i32 [[TMP24]], ptr [[DOTCAPTURE_EXPR_]], align 4
3946 // CHECK37-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3947 // CHECK37-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP25]], 0
3948 // CHECK37-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3949 // CHECK37-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3950 // CHECK37-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3951 // CHECK37-NEXT: [[TMP26:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3952 // CHECK37-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP26]], 1
3953 // CHECK37-NEXT: [[TMP27:%.*]] = zext i32 [[ADD]] to i64
3954 // CHECK37-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3955 // CHECK37-NEXT: store i32 3, ptr [[TMP28]], align 4
3956 // CHECK37-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3957 // CHECK37-NEXT: store i32 4, ptr [[TMP29]], align 4
3958 // CHECK37-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3959 // CHECK37-NEXT: store ptr [[TMP21]], ptr [[TMP30]], align 8
3960 // CHECK37-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3961 // CHECK37-NEXT: store ptr [[TMP22]], ptr [[TMP31]], align 8
3962 // CHECK37-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3963 // CHECK37-NEXT: store ptr [[TMP23]], ptr [[TMP32]], align 8
3964 // CHECK37-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3965 // CHECK37-NEXT: store ptr @.offload_maptypes, ptr [[TMP33]], align 8
3966 // CHECK37-NEXT: [[TMP34:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3967 // CHECK37-NEXT: store ptr null, ptr [[TMP34]], align 8
3968 // CHECK37-NEXT: [[TMP35:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3969 // CHECK37-NEXT: store ptr null, ptr [[TMP35]], align 8
3970 // CHECK37-NEXT: [[TMP36:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3971 // CHECK37-NEXT: store i64 [[TMP27]], ptr [[TMP36]], align 8
3972 // CHECK37-NEXT: [[TMP37:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3973 // CHECK37-NEXT: store i64 0, ptr [[TMP37]], align 8
3974 // CHECK37-NEXT: [[TMP38:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3975 // CHECK37-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP38]], align 4
3976 // CHECK37-NEXT: [[TMP39:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3977 // CHECK37-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP39]], align 4
3978 // CHECK37-NEXT: [[TMP40:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3979 // CHECK37-NEXT: store i32 0, ptr [[TMP40]], align 4
3980 // CHECK37-NEXT: [[TMP41:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.region_id, ptr [[KERNEL_ARGS]])
3981 // CHECK37-NEXT: [[TMP42:%.*]] = icmp ne i32 [[TMP41]], 0
3982 // CHECK37-NEXT: br i1 [[TMP42]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3983 // CHECK37: omp_offload.failed:
3984 // CHECK37-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192(i64 [[TMP4]], i64 [[TMP6]], i64 [[TMP1]], ptr [[VLA]]) #[[ATTR3:[0-9]+]]
3985 // CHECK37-NEXT: br label [[OMP_OFFLOAD_CONT]]
3986 // CHECK37: omp_offload.cont:
3987 // CHECK37-NEXT: [[TMP43:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
3988 // CHECK37-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP43]])
3989 // CHECK37-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
3990 // CHECK37-NEXT: [[TMP44:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
3991 // CHECK37-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP44]])
3992 // CHECK37-NEXT: [[TMP45:%.*]] = load i32, ptr [[RETVAL]], align 4
3993 // CHECK37-NEXT: ret i32 [[TMP45]]
3996 // CHECK37-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192
3997 // CHECK37-SAME: (i64 noundef [[ARGC:%.*]], i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
3998 // CHECK37-NEXT: entry:
3999 // CHECK37-NEXT: [[ARGC_ADDR:%.*]] = alloca i64, align 8
4000 // CHECK37-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
4001 // CHECK37-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
4002 // CHECK37-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
4003 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
4004 // CHECK37-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
4005 // CHECK37-NEXT: store i64 [[ARGC]], ptr [[ARGC_ADDR]], align 8
4006 // CHECK37-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
4007 // CHECK37-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
4008 // CHECK37-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
4009 // CHECK37-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
4010 // CHECK37-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
4011 // CHECK37-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4012 // CHECK37-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP2]], 0
4013 // CHECK37-NEXT: [[STOREDV:%.*]] = zext i1 [[TOBOOL]] to i8
4014 // CHECK37-NEXT: store i8 [[STOREDV]], ptr [[DOTCAPTURE_EXPR_]], align 1
4015 // CHECK37-NEXT: [[TMP3:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
4016 // CHECK37-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP3]] to i1
4017 // CHECK37-NEXT: [[STOREDV1:%.*]] = zext i1 [[LOADEDV]] to i8
4018 // CHECK37-NEXT: store i8 [[STOREDV1]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
4019 // CHECK37-NEXT: [[TMP4:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
4020 // CHECK37-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined, ptr [[N_ADDR]], i64 [[TMP0]], ptr [[TMP1]], i64 [[TMP4]])
4021 // CHECK37-NEXT: ret void
4024 // CHECK37-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined
4025 // CHECK37-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
4026 // CHECK37-NEXT: entry:
4027 // CHECK37-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4028 // CHECK37-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4029 // CHECK37-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
4030 // CHECK37-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
4031 // CHECK37-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
4032 // CHECK37-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
4033 // CHECK37-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4034 // CHECK37-NEXT: [[TMP:%.*]] = alloca i32, align 4
4035 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
4036 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
4037 // CHECK37-NEXT: [[I:%.*]] = alloca i32, align 4
4038 // CHECK37-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4039 // CHECK37-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4040 // CHECK37-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4041 // CHECK37-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4042 // CHECK37-NEXT: [[I4:%.*]] = alloca i32, align 4
4043 // CHECK37-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4044 // CHECK37-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4045 // CHECK37-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
4046 // CHECK37-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
4047 // CHECK37-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
4048 // CHECK37-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
4049 // CHECK37-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
4050 // CHECK37-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
4051 // CHECK37-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
4052 // CHECK37-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
4053 // CHECK37-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4054 // CHECK37-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4055 // CHECK37-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
4056 // CHECK37-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4057 // CHECK37-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
4058 // CHECK37-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
4059 // CHECK37-NEXT: store i32 0, ptr [[I]], align 4
4060 // CHECK37-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4061 // CHECK37-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
4062 // CHECK37-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
4063 // CHECK37: omp.precond.then:
4064 // CHECK37-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4065 // CHECK37-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4066 // CHECK37-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
4067 // CHECK37-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4068 // CHECK37-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4069 // CHECK37-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4070 // CHECK37-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
4071 // CHECK37-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4072 // CHECK37-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4073 // CHECK37-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4074 // CHECK37-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
4075 // CHECK37-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4076 // CHECK37: cond.true:
4077 // CHECK37-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4078 // CHECK37-NEXT: br label [[COND_END:%.*]]
4079 // CHECK37: cond.false:
4080 // CHECK37-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4081 // CHECK37-NEXT: br label [[COND_END]]
4082 // CHECK37: cond.end:
4083 // CHECK37-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
4084 // CHECK37-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4085 // CHECK37-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4086 // CHECK37-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
4087 // CHECK37-NEXT: [[TMP14:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
4088 // CHECK37-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP14]] to i1
4089 // CHECK37-NEXT: br i1 [[LOADEDV]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
4090 // CHECK37: omp_if.then:
4091 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4092 // CHECK37: omp.inner.for.cond:
4093 // CHECK37-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
4094 // CHECK37-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
4095 // CHECK37-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
4096 // CHECK37-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4097 // CHECK37: omp.inner.for.body:
4098 // CHECK37-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
4099 // CHECK37-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
4100 // CHECK37-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4101 // CHECK37-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP5]]
4102 // CHECK37-NEXT: [[TMP18:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP5]]
4103 // CHECK37-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP18]] to i64
4104 // CHECK37-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
4105 // CHECK37-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
4106 // CHECK37-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4107 // CHECK37: omp.body.continue:
4108 // CHECK37-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4109 // CHECK37: omp.inner.for.inc:
4110 // CHECK37-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
4111 // CHECK37-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP19]], 1
4112 // CHECK37-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
4113 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
4114 // CHECK37: omp.inner.for.end:
4115 // CHECK37-NEXT: br label [[OMP_IF_END:%.*]]
4116 // CHECK37: omp_if.else:
4117 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND8:%.*]]
4118 // CHECK37: omp.inner.for.cond8:
4119 // CHECK37-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4120 // CHECK37-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4121 // CHECK37-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP20]], [[TMP21]]
4122 // CHECK37-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY10:%.*]], label [[OMP_INNER_FOR_END18:%.*]]
4123 // CHECK37: omp.inner.for.body10:
4124 // CHECK37-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4125 // CHECK37-NEXT: [[MUL11:%.*]] = mul nsw i32 [[TMP22]], 1
4126 // CHECK37-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
4127 // CHECK37-NEXT: store i32 [[ADD12]], ptr [[I4]], align 4
4128 // CHECK37-NEXT: [[TMP23:%.*]] = load i32, ptr [[I4]], align 4
4129 // CHECK37-NEXT: [[IDXPROM13:%.*]] = sext i32 [[TMP23]] to i64
4130 // CHECK37-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM13]]
4131 // CHECK37-NEXT: store i32 0, ptr [[ARRAYIDX14]], align 4
4132 // CHECK37-NEXT: br label [[OMP_BODY_CONTINUE15:%.*]]
4133 // CHECK37: omp.body.continue15:
4134 // CHECK37-NEXT: br label [[OMP_INNER_FOR_INC16:%.*]]
4135 // CHECK37: omp.inner.for.inc16:
4136 // CHECK37-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4137 // CHECK37-NEXT: [[ADD17:%.*]] = add nsw i32 [[TMP24]], 1
4138 // CHECK37-NEXT: store i32 [[ADD17]], ptr [[DOTOMP_IV]], align 4
4139 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND8]], !llvm.loop [[LOOP9:![0-9]+]]
4140 // CHECK37: omp.inner.for.end18:
4141 // CHECK37-NEXT: br label [[OMP_IF_END]]
4142 // CHECK37: omp_if.end:
4143 // CHECK37-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4144 // CHECK37: omp.loop.exit:
4145 // CHECK37-NEXT: [[TMP25:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4146 // CHECK37-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP25]], align 4
4147 // CHECK37-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP26]])
4148 // CHECK37-NEXT: [[TMP27:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4149 // CHECK37-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
4150 // CHECK37-NEXT: br i1 [[TMP28]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4151 // CHECK37: .omp.final.then:
4152 // CHECK37-NEXT: [[TMP29:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4153 // CHECK37-NEXT: [[SUB19:%.*]] = sub nsw i32 [[TMP29]], 0
4154 // CHECK37-NEXT: [[DIV20:%.*]] = sdiv i32 [[SUB19]], 1
4155 // CHECK37-NEXT: [[MUL21:%.*]] = mul nsw i32 [[DIV20]], 1
4156 // CHECK37-NEXT: [[ADD22:%.*]] = add nsw i32 0, [[MUL21]]
4157 // CHECK37-NEXT: store i32 [[ADD22]], ptr [[I4]], align 4
4158 // CHECK37-NEXT: br label [[DOTOMP_FINAL_DONE]]
4159 // CHECK37: .omp.final.done:
4160 // CHECK37-NEXT: br label [[OMP_PRECOND_END]]
4161 // CHECK37: omp.precond.end:
4162 // CHECK37-NEXT: ret void
4165 // CHECK37-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
4166 // CHECK37-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat {
4167 // CHECK37-NEXT: entry:
4168 // CHECK37-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4169 // CHECK37-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
4170 // CHECK37-NEXT: [[TE:%.*]] = alloca i32, align 4
4171 // CHECK37-NEXT: [[TH:%.*]] = alloca i32, align 4
4172 // CHECK37-NEXT: [[TE_CASTED:%.*]] = alloca i64, align 8
4173 // CHECK37-NEXT: [[TH_CASTED:%.*]] = alloca i64, align 8
4174 // CHECK37-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
4175 // CHECK37-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
4176 // CHECK37-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
4177 // CHECK37-NEXT: [[TMP:%.*]] = alloca i32, align 4
4178 // CHECK37-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4179 // CHECK37-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4180 // CHECK37-NEXT: store i32 0, ptr [[TE]], align 4
4181 // CHECK37-NEXT: store i32 128, ptr [[TH]], align 4
4182 // CHECK37-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
4183 // CHECK37-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
4184 // CHECK37-NEXT: [[TMP1:%.*]] = load i64, ptr [[TE_CASTED]], align 8
4185 // CHECK37-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
4186 // CHECK37-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
4187 // CHECK37-NEXT: [[TMP3:%.*]] = load i64, ptr [[TH_CASTED]], align 8
4188 // CHECK37-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4189 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[TMP4]], align 8
4190 // CHECK37-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4191 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[TMP5]], align 8
4192 // CHECK37-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
4193 // CHECK37-NEXT: store ptr null, ptr [[TMP6]], align 8
4194 // CHECK37-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
4195 // CHECK37-NEXT: store i64 [[TMP3]], ptr [[TMP7]], align 8
4196 // CHECK37-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
4197 // CHECK37-NEXT: store i64 [[TMP3]], ptr [[TMP8]], align 8
4198 // CHECK37-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
4199 // CHECK37-NEXT: store ptr null, ptr [[TMP9]], align 8
4200 // CHECK37-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
4201 // CHECK37-NEXT: store ptr [[A]], ptr [[TMP10]], align 8
4202 // CHECK37-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
4203 // CHECK37-NEXT: store ptr [[A]], ptr [[TMP11]], align 8
4204 // CHECK37-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
4205 // CHECK37-NEXT: store ptr null, ptr [[TMP12]], align 8
4206 // CHECK37-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4207 // CHECK37-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4208 // CHECK37-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
4209 // CHECK37-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
4210 // CHECK37-NEXT: [[TMP17:%.*]] = icmp ult i32 [[TMP16]], 1
4211 // CHECK37-NEXT: [[TMP18:%.*]] = select i1 [[TMP17]], i32 [[TMP16]], i32 1
4212 // CHECK37-NEXT: [[TMP19:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
4213 // CHECK37-NEXT: [[TMP20:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP18]], 0
4214 // CHECK37-NEXT: [[TMP21:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4215 // CHECK37-NEXT: store i32 3, ptr [[TMP21]], align 4
4216 // CHECK37-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4217 // CHECK37-NEXT: store i32 3, ptr [[TMP22]], align 4
4218 // CHECK37-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4219 // CHECK37-NEXT: store ptr [[TMP13]], ptr [[TMP23]], align 8
4220 // CHECK37-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4221 // CHECK37-NEXT: store ptr [[TMP14]], ptr [[TMP24]], align 8
4222 // CHECK37-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4223 // CHECK37-NEXT: store ptr @.offload_sizes.1, ptr [[TMP25]], align 8
4224 // CHECK37-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4225 // CHECK37-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP26]], align 8
4226 // CHECK37-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4227 // CHECK37-NEXT: store ptr null, ptr [[TMP27]], align 8
4228 // CHECK37-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4229 // CHECK37-NEXT: store ptr null, ptr [[TMP28]], align 8
4230 // CHECK37-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4231 // CHECK37-NEXT: store i64 10, ptr [[TMP29]], align 8
4232 // CHECK37-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4233 // CHECK37-NEXT: store i64 0, ptr [[TMP30]], align 8
4234 // CHECK37-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4235 // CHECK37-NEXT: store [3 x i32] [[TMP19]], ptr [[TMP31]], align 4
4236 // CHECK37-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4237 // CHECK37-NEXT: store [3 x i32] [[TMP20]], ptr [[TMP32]], align 4
4238 // CHECK37-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4239 // CHECK37-NEXT: store i32 0, ptr [[TMP33]], align 4
4240 // CHECK37-NEXT: [[TMP34:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 [[TMP15]], i32 [[TMP18]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.region_id, ptr [[KERNEL_ARGS]])
4241 // CHECK37-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
4242 // CHECK37-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4243 // CHECK37: omp_offload.failed:
4244 // CHECK37-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181(i64 [[TMP1]], i64 [[TMP3]], ptr [[A]]) #[[ATTR3]]
4245 // CHECK37-NEXT: br label [[OMP_OFFLOAD_CONT]]
4246 // CHECK37: omp_offload.cont:
4247 // CHECK37-NEXT: ret i32 0
4250 // CHECK37-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181
4251 // CHECK37-SAME: (i64 noundef [[TE:%.*]], i64 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
4252 // CHECK37-NEXT: entry:
4253 // CHECK37-NEXT: [[TE_ADDR:%.*]] = alloca i64, align 8
4254 // CHECK37-NEXT: [[TH_ADDR:%.*]] = alloca i64, align 8
4255 // CHECK37-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
4256 // CHECK37-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4257 // CHECK37-NEXT: store i64 [[TE]], ptr [[TE_ADDR]], align 8
4258 // CHECK37-NEXT: store i64 [[TH]], ptr [[TH_ADDR]], align 8
4259 // CHECK37-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
4260 // CHECK37-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
4261 // CHECK37-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
4262 // CHECK37-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
4263 // CHECK37-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
4264 // CHECK37-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined, ptr [[TMP1]])
4265 // CHECK37-NEXT: ret void
4268 // CHECK37-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined
4269 // CHECK37-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
4270 // CHECK37-NEXT: entry:
4271 // CHECK37-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4272 // CHECK37-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4273 // CHECK37-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
4274 // CHECK37-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4275 // CHECK37-NEXT: [[TMP:%.*]] = alloca i32, align 4
4276 // CHECK37-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4277 // CHECK37-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4278 // CHECK37-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4279 // CHECK37-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4280 // CHECK37-NEXT: [[I:%.*]] = alloca i32, align 4
4281 // CHECK37-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4282 // CHECK37-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4283 // CHECK37-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
4284 // CHECK37-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
4285 // CHECK37-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4286 // CHECK37-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
4287 // CHECK37-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4288 // CHECK37-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4289 // CHECK37-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4290 // CHECK37-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
4291 // CHECK37-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4292 // CHECK37-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4293 // CHECK37-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
4294 // CHECK37-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4295 // CHECK37: cond.true:
4296 // CHECK37-NEXT: br label [[COND_END:%.*]]
4297 // CHECK37: cond.false:
4298 // CHECK37-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4299 // CHECK37-NEXT: br label [[COND_END]]
4300 // CHECK37: cond.end:
4301 // CHECK37-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
4302 // CHECK37-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4303 // CHECK37-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4304 // CHECK37-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
4305 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4306 // CHECK37: omp.inner.for.cond:
4307 // CHECK37-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP13:![0-9]+]]
4308 // CHECK37-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP13]]
4309 // CHECK37-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
4310 // CHECK37-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4311 // CHECK37: omp.inner.for.body:
4312 // CHECK37-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP13]]
4313 // CHECK37-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
4314 // CHECK37-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4315 // CHECK37-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP13]]
4316 // CHECK37-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP13]]
4317 // CHECK37-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
4318 // CHECK37-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i64 0, i64 [[IDXPROM]]
4319 // CHECK37-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP13]]
4320 // CHECK37-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4321 // CHECK37: omp.body.continue:
4322 // CHECK37-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4323 // CHECK37: omp.inner.for.inc:
4324 // CHECK37-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP13]]
4325 // CHECK37-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
4326 // CHECK37-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP13]]
4327 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP14:![0-9]+]]
4328 // CHECK37: omp.inner.for.end:
4329 // CHECK37-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4330 // CHECK37: omp.loop.exit:
4331 // CHECK37-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
4332 // CHECK37-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4333 // CHECK37-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4334 // CHECK37-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4335 // CHECK37: .omp.final.then:
4336 // CHECK37-NEXT: store i32 10, ptr [[I]], align 4
4337 // CHECK37-NEXT: br label [[DOTOMP_FINAL_DONE]]
4338 // CHECK37: .omp.final.done:
4339 // CHECK37-NEXT: ret void
4342 // CHECK39-LABEL: define {{[^@]+}}@main
4343 // CHECK39-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
4344 // CHECK39-NEXT: entry:
4345 // CHECK39-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
4346 // CHECK39-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4347 // CHECK39-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
4348 // CHECK39-NEXT: [[N:%.*]] = alloca i32, align 4
4349 // CHECK39-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
4350 // CHECK39-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
4351 // CHECK39-NEXT: [[ARGC_CASTED:%.*]] = alloca i32, align 4
4352 // CHECK39-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
4353 // CHECK39-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 4
4354 // CHECK39-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 4
4355 // CHECK39-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 4
4356 // CHECK39-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [4 x i64], align 4
4357 // CHECK39-NEXT: [[TMP:%.*]] = alloca i32, align 4
4358 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
4359 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
4360 // CHECK39-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4361 // CHECK39-NEXT: store i32 0, ptr [[RETVAL]], align 4
4362 // CHECK39-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4363 // CHECK39-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
4364 // CHECK39-NEXT: store i32 100, ptr [[N]], align 4
4365 // CHECK39-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
4366 // CHECK39-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
4367 // CHECK39-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
4368 // CHECK39-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
4369 // CHECK39-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
4370 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4371 // CHECK39-NEXT: store i32 [[TMP2]], ptr [[ARGC_CASTED]], align 4
4372 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARGC_CASTED]], align 4
4373 // CHECK39-NEXT: [[TMP4:%.*]] = load i32, ptr [[N]], align 4
4374 // CHECK39-NEXT: store i32 [[TMP4]], ptr [[N_CASTED]], align 4
4375 // CHECK39-NEXT: [[TMP5:%.*]] = load i32, ptr [[N_CASTED]], align 4
4376 // CHECK39-NEXT: [[TMP6:%.*]] = mul nuw i32 [[TMP0]], 4
4377 // CHECK39-NEXT: [[TMP7:%.*]] = sext i32 [[TMP6]] to i64
4378 // CHECK39-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 32, i1 false)
4379 // CHECK39-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4380 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[TMP8]], align 4
4381 // CHECK39-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4382 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[TMP9]], align 4
4383 // CHECK39-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
4384 // CHECK39-NEXT: store ptr null, ptr [[TMP10]], align 4
4385 // CHECK39-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
4386 // CHECK39-NEXT: store i32 [[TMP5]], ptr [[TMP11]], align 4
4387 // CHECK39-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
4388 // CHECK39-NEXT: store i32 [[TMP5]], ptr [[TMP12]], align 4
4389 // CHECK39-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
4390 // CHECK39-NEXT: store ptr null, ptr [[TMP13]], align 4
4391 // CHECK39-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
4392 // CHECK39-NEXT: store i32 [[TMP0]], ptr [[TMP14]], align 4
4393 // CHECK39-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
4394 // CHECK39-NEXT: store i32 [[TMP0]], ptr [[TMP15]], align 4
4395 // CHECK39-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
4396 // CHECK39-NEXT: store ptr null, ptr [[TMP16]], align 4
4397 // CHECK39-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
4398 // CHECK39-NEXT: store ptr [[VLA]], ptr [[TMP17]], align 4
4399 // CHECK39-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
4400 // CHECK39-NEXT: store ptr [[VLA]], ptr [[TMP18]], align 4
4401 // CHECK39-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 3
4402 // CHECK39-NEXT: store i64 [[TMP7]], ptr [[TMP19]], align 4
4403 // CHECK39-NEXT: [[TMP20:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 3
4404 // CHECK39-NEXT: store ptr null, ptr [[TMP20]], align 4
4405 // CHECK39-NEXT: [[TMP21:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4406 // CHECK39-NEXT: [[TMP22:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4407 // CHECK39-NEXT: [[TMP23:%.*]] = getelementptr inbounds [4 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
4408 // CHECK39-NEXT: [[TMP24:%.*]] = load i32, ptr [[N]], align 4
4409 // CHECK39-NEXT: store i32 [[TMP24]], ptr [[DOTCAPTURE_EXPR_]], align 4
4410 // CHECK39-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4411 // CHECK39-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP25]], 0
4412 // CHECK39-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4413 // CHECK39-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
4414 // CHECK39-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4415 // CHECK39-NEXT: [[TMP26:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4416 // CHECK39-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP26]], 1
4417 // CHECK39-NEXT: [[TMP27:%.*]] = zext i32 [[ADD]] to i64
4418 // CHECK39-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4419 // CHECK39-NEXT: store i32 3, ptr [[TMP28]], align 4
4420 // CHECK39-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4421 // CHECK39-NEXT: store i32 4, ptr [[TMP29]], align 4
4422 // CHECK39-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4423 // CHECK39-NEXT: store ptr [[TMP21]], ptr [[TMP30]], align 4
4424 // CHECK39-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4425 // CHECK39-NEXT: store ptr [[TMP22]], ptr [[TMP31]], align 4
4426 // CHECK39-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4427 // CHECK39-NEXT: store ptr [[TMP23]], ptr [[TMP32]], align 4
4428 // CHECK39-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4429 // CHECK39-NEXT: store ptr @.offload_maptypes, ptr [[TMP33]], align 4
4430 // CHECK39-NEXT: [[TMP34:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4431 // CHECK39-NEXT: store ptr null, ptr [[TMP34]], align 4
4432 // CHECK39-NEXT: [[TMP35:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4433 // CHECK39-NEXT: store ptr null, ptr [[TMP35]], align 4
4434 // CHECK39-NEXT: [[TMP36:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4435 // CHECK39-NEXT: store i64 [[TMP27]], ptr [[TMP36]], align 8
4436 // CHECK39-NEXT: [[TMP37:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4437 // CHECK39-NEXT: store i64 0, ptr [[TMP37]], align 8
4438 // CHECK39-NEXT: [[TMP38:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4439 // CHECK39-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP38]], align 4
4440 // CHECK39-NEXT: [[TMP39:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4441 // CHECK39-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP39]], align 4
4442 // CHECK39-NEXT: [[TMP40:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4443 // CHECK39-NEXT: store i32 0, ptr [[TMP40]], align 4
4444 // CHECK39-NEXT: [[TMP41:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.region_id, ptr [[KERNEL_ARGS]])
4445 // CHECK39-NEXT: [[TMP42:%.*]] = icmp ne i32 [[TMP41]], 0
4446 // CHECK39-NEXT: br i1 [[TMP42]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4447 // CHECK39: omp_offload.failed:
4448 // CHECK39-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192(i32 [[TMP3]], i32 [[TMP5]], i32 [[TMP0]], ptr [[VLA]]) #[[ATTR3:[0-9]+]]
4449 // CHECK39-NEXT: br label [[OMP_OFFLOAD_CONT]]
4450 // CHECK39: omp_offload.cont:
4451 // CHECK39-NEXT: [[TMP43:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4452 // CHECK39-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP43]])
4453 // CHECK39-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
4454 // CHECK39-NEXT: [[TMP44:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
4455 // CHECK39-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP44]])
4456 // CHECK39-NEXT: [[TMP45:%.*]] = load i32, ptr [[RETVAL]], align 4
4457 // CHECK39-NEXT: ret i32 [[TMP45]]
4460 // CHECK39-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192
4461 // CHECK39-SAME: (i32 noundef [[ARGC:%.*]], i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
4462 // CHECK39-NEXT: entry:
4463 // CHECK39-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4464 // CHECK39-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
4465 // CHECK39-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
4466 // CHECK39-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
4467 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
4468 // CHECK39-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
4469 // CHECK39-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4470 // CHECK39-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
4471 // CHECK39-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
4472 // CHECK39-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
4473 // CHECK39-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
4474 // CHECK39-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
4475 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4476 // CHECK39-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP2]], 0
4477 // CHECK39-NEXT: [[STOREDV:%.*]] = zext i1 [[TOBOOL]] to i8
4478 // CHECK39-NEXT: store i8 [[STOREDV]], ptr [[DOTCAPTURE_EXPR_]], align 1
4479 // CHECK39-NEXT: [[TMP3:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
4480 // CHECK39-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP3]] to i1
4481 // CHECK39-NEXT: [[STOREDV1:%.*]] = zext i1 [[LOADEDV]] to i8
4482 // CHECK39-NEXT: store i8 [[STOREDV1]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
4483 // CHECK39-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR__CASTED]], align 4
4484 // CHECK39-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined, ptr [[N_ADDR]], i32 [[TMP0]], ptr [[TMP1]], i32 [[TMP4]])
4485 // CHECK39-NEXT: ret void
4488 // CHECK39-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined
4489 // CHECK39-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
4490 // CHECK39-NEXT: entry:
4491 // CHECK39-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
4492 // CHECK39-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
4493 // CHECK39-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
4494 // CHECK39-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
4495 // CHECK39-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
4496 // CHECK39-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
4497 // CHECK39-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4498 // CHECK39-NEXT: [[TMP:%.*]] = alloca i32, align 4
4499 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
4500 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
4501 // CHECK39-NEXT: [[I:%.*]] = alloca i32, align 4
4502 // CHECK39-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4503 // CHECK39-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4504 // CHECK39-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4505 // CHECK39-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4506 // CHECK39-NEXT: [[I4:%.*]] = alloca i32, align 4
4507 // CHECK39-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
4508 // CHECK39-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
4509 // CHECK39-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
4510 // CHECK39-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
4511 // CHECK39-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
4512 // CHECK39-NEXT: store i32 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 4
4513 // CHECK39-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
4514 // CHECK39-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
4515 // CHECK39-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
4516 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
4517 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4518 // CHECK39-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4519 // CHECK39-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
4520 // CHECK39-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4521 // CHECK39-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
4522 // CHECK39-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
4523 // CHECK39-NEXT: store i32 0, ptr [[I]], align 4
4524 // CHECK39-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4525 // CHECK39-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
4526 // CHECK39-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
4527 // CHECK39: omp.precond.then:
4528 // CHECK39-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4529 // CHECK39-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4530 // CHECK39-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
4531 // CHECK39-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4532 // CHECK39-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4533 // CHECK39-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
4534 // CHECK39-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
4535 // CHECK39-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4536 // CHECK39-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4537 // CHECK39-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4538 // CHECK39-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
4539 // CHECK39-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4540 // CHECK39: cond.true:
4541 // CHECK39-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4542 // CHECK39-NEXT: br label [[COND_END:%.*]]
4543 // CHECK39: cond.false:
4544 // CHECK39-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4545 // CHECK39-NEXT: br label [[COND_END]]
4546 // CHECK39: cond.end:
4547 // CHECK39-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
4548 // CHECK39-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4549 // CHECK39-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4550 // CHECK39-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
4551 // CHECK39-NEXT: [[TMP14:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
4552 // CHECK39-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP14]] to i1
4553 // CHECK39-NEXT: br i1 [[LOADEDV]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
4554 // CHECK39: omp_if.then:
4555 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4556 // CHECK39: omp.inner.for.cond:
4557 // CHECK39-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
4558 // CHECK39-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP6]]
4559 // CHECK39-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
4560 // CHECK39-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4561 // CHECK39: omp.inner.for.body:
4562 // CHECK39-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4563 // CHECK39-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
4564 // CHECK39-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4565 // CHECK39-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP6]]
4566 // CHECK39-NEXT: [[TMP18:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP6]]
4567 // CHECK39-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP18]]
4568 // CHECK39-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP6]]
4569 // CHECK39-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4570 // CHECK39: omp.body.continue:
4571 // CHECK39-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4572 // CHECK39: omp.inner.for.inc:
4573 // CHECK39-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4574 // CHECK39-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP19]], 1
4575 // CHECK39-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4576 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
4577 // CHECK39: omp.inner.for.end:
4578 // CHECK39-NEXT: br label [[OMP_IF_END:%.*]]
4579 // CHECK39: omp_if.else:
4580 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND8:%.*]]
4581 // CHECK39: omp.inner.for.cond8:
4582 // CHECK39-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4583 // CHECK39-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4584 // CHECK39-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP20]], [[TMP21]]
4585 // CHECK39-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY10:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
4586 // CHECK39: omp.inner.for.body10:
4587 // CHECK39-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4588 // CHECK39-NEXT: [[MUL11:%.*]] = mul nsw i32 [[TMP22]], 1
4589 // CHECK39-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
4590 // CHECK39-NEXT: store i32 [[ADD12]], ptr [[I4]], align 4
4591 // CHECK39-NEXT: [[TMP23:%.*]] = load i32, ptr [[I4]], align 4
4592 // CHECK39-NEXT: [[ARRAYIDX13:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP23]]
4593 // CHECK39-NEXT: store i32 0, ptr [[ARRAYIDX13]], align 4
4594 // CHECK39-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
4595 // CHECK39: omp.body.continue14:
4596 // CHECK39-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
4597 // CHECK39: omp.inner.for.inc15:
4598 // CHECK39-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4599 // CHECK39-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP24]], 1
4600 // CHECK39-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
4601 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND8]], !llvm.loop [[LOOP10:![0-9]+]]
4602 // CHECK39: omp.inner.for.end17:
4603 // CHECK39-NEXT: br label [[OMP_IF_END]]
4604 // CHECK39: omp_if.end:
4605 // CHECK39-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4606 // CHECK39: omp.loop.exit:
4607 // CHECK39-NEXT: [[TMP25:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
4608 // CHECK39-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP25]], align 4
4609 // CHECK39-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP26]])
4610 // CHECK39-NEXT: [[TMP27:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4611 // CHECK39-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
4612 // CHECK39-NEXT: br i1 [[TMP28]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4613 // CHECK39: .omp.final.then:
4614 // CHECK39-NEXT: [[TMP29:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4615 // CHECK39-NEXT: [[SUB18:%.*]] = sub nsw i32 [[TMP29]], 0
4616 // CHECK39-NEXT: [[DIV19:%.*]] = sdiv i32 [[SUB18]], 1
4617 // CHECK39-NEXT: [[MUL20:%.*]] = mul nsw i32 [[DIV19]], 1
4618 // CHECK39-NEXT: [[ADD21:%.*]] = add nsw i32 0, [[MUL20]]
4619 // CHECK39-NEXT: store i32 [[ADD21]], ptr [[I4]], align 4
4620 // CHECK39-NEXT: br label [[DOTOMP_FINAL_DONE]]
4621 // CHECK39: .omp.final.done:
4622 // CHECK39-NEXT: br label [[OMP_PRECOND_END]]
4623 // CHECK39: omp.precond.end:
4624 // CHECK39-NEXT: ret void
4627 // CHECK39-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
4628 // CHECK39-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat {
4629 // CHECK39-NEXT: entry:
4630 // CHECK39-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4631 // CHECK39-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
4632 // CHECK39-NEXT: [[TE:%.*]] = alloca i32, align 4
4633 // CHECK39-NEXT: [[TH:%.*]] = alloca i32, align 4
4634 // CHECK39-NEXT: [[TE_CASTED:%.*]] = alloca i32, align 4
4635 // CHECK39-NEXT: [[TH_CASTED:%.*]] = alloca i32, align 4
4636 // CHECK39-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
4637 // CHECK39-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
4638 // CHECK39-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
4639 // CHECK39-NEXT: [[TMP:%.*]] = alloca i32, align 4
4640 // CHECK39-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4641 // CHECK39-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4642 // CHECK39-NEXT: store i32 0, ptr [[TE]], align 4
4643 // CHECK39-NEXT: store i32 128, ptr [[TH]], align 4
4644 // CHECK39-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
4645 // CHECK39-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
4646 // CHECK39-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE_CASTED]], align 4
4647 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
4648 // CHECK39-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
4649 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_CASTED]], align 4
4650 // CHECK39-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4651 // CHECK39-NEXT: store i32 [[TMP1]], ptr [[TMP4]], align 4
4652 // CHECK39-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4653 // CHECK39-NEXT: store i32 [[TMP1]], ptr [[TMP5]], align 4
4654 // CHECK39-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
4655 // CHECK39-NEXT: store ptr null, ptr [[TMP6]], align 4
4656 // CHECK39-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
4657 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
4658 // CHECK39-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
4659 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[TMP8]], align 4
4660 // CHECK39-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
4661 // CHECK39-NEXT: store ptr null, ptr [[TMP9]], align 4
4662 // CHECK39-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
4663 // CHECK39-NEXT: store ptr [[A]], ptr [[TMP10]], align 4
4664 // CHECK39-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
4665 // CHECK39-NEXT: store ptr [[A]], ptr [[TMP11]], align 4
4666 // CHECK39-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
4667 // CHECK39-NEXT: store ptr null, ptr [[TMP12]], align 4
4668 // CHECK39-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4669 // CHECK39-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4670 // CHECK39-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
4671 // CHECK39-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
4672 // CHECK39-NEXT: [[TMP17:%.*]] = icmp ult i32 [[TMP16]], 1
4673 // CHECK39-NEXT: [[TMP18:%.*]] = select i1 [[TMP17]], i32 [[TMP16]], i32 1
4674 // CHECK39-NEXT: [[TMP19:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
4675 // CHECK39-NEXT: [[TMP20:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP18]], 0
4676 // CHECK39-NEXT: [[TMP21:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4677 // CHECK39-NEXT: store i32 3, ptr [[TMP21]], align 4
4678 // CHECK39-NEXT: [[TMP22:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4679 // CHECK39-NEXT: store i32 3, ptr [[TMP22]], align 4
4680 // CHECK39-NEXT: [[TMP23:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4681 // CHECK39-NEXT: store ptr [[TMP13]], ptr [[TMP23]], align 4
4682 // CHECK39-NEXT: [[TMP24:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4683 // CHECK39-NEXT: store ptr [[TMP14]], ptr [[TMP24]], align 4
4684 // CHECK39-NEXT: [[TMP25:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4685 // CHECK39-NEXT: store ptr @.offload_sizes.1, ptr [[TMP25]], align 4
4686 // CHECK39-NEXT: [[TMP26:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4687 // CHECK39-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP26]], align 4
4688 // CHECK39-NEXT: [[TMP27:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4689 // CHECK39-NEXT: store ptr null, ptr [[TMP27]], align 4
4690 // CHECK39-NEXT: [[TMP28:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4691 // CHECK39-NEXT: store ptr null, ptr [[TMP28]], align 4
4692 // CHECK39-NEXT: [[TMP29:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4693 // CHECK39-NEXT: store i64 10, ptr [[TMP29]], align 8
4694 // CHECK39-NEXT: [[TMP30:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4695 // CHECK39-NEXT: store i64 0, ptr [[TMP30]], align 8
4696 // CHECK39-NEXT: [[TMP31:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4697 // CHECK39-NEXT: store [3 x i32] [[TMP19]], ptr [[TMP31]], align 4
4698 // CHECK39-NEXT: [[TMP32:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4699 // CHECK39-NEXT: store [3 x i32] [[TMP20]], ptr [[TMP32]], align 4
4700 // CHECK39-NEXT: [[TMP33:%.*]] = getelementptr inbounds nuw [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4701 // CHECK39-NEXT: store i32 0, ptr [[TMP33]], align 4
4702 // CHECK39-NEXT: [[TMP34:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 [[TMP15]], i32 [[TMP18]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.region_id, ptr [[KERNEL_ARGS]])
4703 // CHECK39-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
4704 // CHECK39-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4705 // CHECK39: omp_offload.failed:
4706 // CHECK39-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181(i32 [[TMP1]], i32 [[TMP3]], ptr [[A]]) #[[ATTR3]]
4707 // CHECK39-NEXT: br label [[OMP_OFFLOAD_CONT]]
4708 // CHECK39: omp_offload.cont:
4709 // CHECK39-NEXT: ret i32 0
4712 // CHECK39-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181
4713 // CHECK39-SAME: (i32 noundef [[TE:%.*]], i32 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
4714 // CHECK39-NEXT: entry:
4715 // CHECK39-NEXT: [[TE_ADDR:%.*]] = alloca i32, align 4
4716 // CHECK39-NEXT: [[TH_ADDR:%.*]] = alloca i32, align 4
4717 // CHECK39-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
4718 // CHECK39-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4719 // CHECK39-NEXT: store i32 [[TE]], ptr [[TE_ADDR]], align 4
4720 // CHECK39-NEXT: store i32 [[TH]], ptr [[TH_ADDR]], align 4
4721 // CHECK39-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
4722 // CHECK39-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
4723 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
4724 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
4725 // CHECK39-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
4726 // CHECK39-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined, ptr [[TMP1]])
4727 // CHECK39-NEXT: ret void
4730 // CHECK39-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined
4731 // CHECK39-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
4732 // CHECK39-NEXT: entry:
4733 // CHECK39-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
4734 // CHECK39-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
4735 // CHECK39-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
4736 // CHECK39-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4737 // CHECK39-NEXT: [[TMP:%.*]] = alloca i32, align 4
4738 // CHECK39-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4739 // CHECK39-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4740 // CHECK39-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4741 // CHECK39-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4742 // CHECK39-NEXT: [[I:%.*]] = alloca i32, align 4
4743 // CHECK39-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
4744 // CHECK39-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
4745 // CHECK39-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
4746 // CHECK39-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
4747 // CHECK39-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4748 // CHECK39-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
4749 // CHECK39-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4750 // CHECK39-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4751 // CHECK39-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
4752 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
4753 // CHECK39-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4754 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4755 // CHECK39-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
4756 // CHECK39-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4757 // CHECK39: cond.true:
4758 // CHECK39-NEXT: br label [[COND_END:%.*]]
4759 // CHECK39: cond.false:
4760 // CHECK39-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4761 // CHECK39-NEXT: br label [[COND_END]]
4762 // CHECK39: cond.end:
4763 // CHECK39-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
4764 // CHECK39-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4765 // CHECK39-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4766 // CHECK39-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
4767 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4768 // CHECK39: omp.inner.for.cond:
4769 // CHECK39-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14:![0-9]+]]
4770 // CHECK39-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP14]]
4771 // CHECK39-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
4772 // CHECK39-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4773 // CHECK39: omp.inner.for.body:
4774 // CHECK39-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14]]
4775 // CHECK39-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
4776 // CHECK39-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4777 // CHECK39-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP14]]
4778 // CHECK39-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP14]]
4779 // CHECK39-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i32 0, i32 [[TMP9]]
4780 // CHECK39-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP14]]
4781 // CHECK39-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4782 // CHECK39: omp.body.continue:
4783 // CHECK39-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4784 // CHECK39: omp.inner.for.inc:
4785 // CHECK39-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14]]
4786 // CHECK39-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
4787 // CHECK39-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14]]
4788 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]]
4789 // CHECK39: omp.inner.for.end:
4790 // CHECK39-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4791 // CHECK39: omp.loop.exit:
4792 // CHECK39-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
4793 // CHECK39-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4794 // CHECK39-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4795 // CHECK39-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4796 // CHECK39: .omp.final.then:
4797 // CHECK39-NEXT: store i32 10, ptr [[I]], align 4
4798 // CHECK39-NEXT: br label [[DOTOMP_FINAL_DONE]]
4799 // CHECK39: .omp.final.done:
4800 // CHECK39-NEXT: ret void
4803 // CHECK41-LABEL: define {{[^@]+}}@main
4804 // CHECK41-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
4805 // CHECK41-NEXT: entry:
4806 // CHECK41-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
4807 // CHECK41-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4808 // CHECK41-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
4809 // CHECK41-NEXT: [[N:%.*]] = alloca i32, align 4
4810 // CHECK41-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
4811 // CHECK41-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
4812 // CHECK41-NEXT: [[TMP:%.*]] = alloca i32, align 4
4813 // CHECK41-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
4814 // CHECK41-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
4815 // CHECK41-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4816 // CHECK41-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4817 // CHECK41-NEXT: [[I:%.*]] = alloca i32, align 4
4818 // CHECK41-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4819 // CHECK41-NEXT: [[I3:%.*]] = alloca i32, align 4
4820 // CHECK41-NEXT: store i32 0, ptr [[RETVAL]], align 4
4821 // CHECK41-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4822 // CHECK41-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
4823 // CHECK41-NEXT: store i32 100, ptr [[N]], align 4
4824 // CHECK41-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
4825 // CHECK41-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
4826 // CHECK41-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
4827 // CHECK41-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
4828 // CHECK41-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
4829 // CHECK41-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
4830 // CHECK41-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
4831 // CHECK41-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
4832 // CHECK41-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4833 // CHECK41-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
4834 // CHECK41-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4835 // CHECK41-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
4836 // CHECK41-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4837 // CHECK41-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4838 // CHECK41-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4839 // CHECK41-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
4840 // CHECK41-NEXT: store i32 0, ptr [[I]], align 4
4841 // CHECK41-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4842 // CHECK41-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP6]]
4843 // CHECK41-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
4844 // CHECK41: simd.if.then:
4845 // CHECK41-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4846 // CHECK41-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
4847 // CHECK41-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4848 // CHECK41: omp.inner.for.cond:
4849 // CHECK41-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
4850 // CHECK41-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
4851 // CHECK41-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
4852 // CHECK41-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4853 // CHECK41: omp.inner.for.body:
4854 // CHECK41-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
4855 // CHECK41-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
4856 // CHECK41-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4857 // CHECK41-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP2]]
4858 // CHECK41-NEXT: [[TMP11:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP2]]
4859 // CHECK41-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
4860 // CHECK41-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 [[IDXPROM]]
4861 // CHECK41-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
4862 // CHECK41-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4863 // CHECK41: omp.body.continue:
4864 // CHECK41-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4865 // CHECK41: omp.inner.for.inc:
4866 // CHECK41-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
4867 // CHECK41-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP12]], 1
4868 // CHECK41-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
4869 // CHECK41-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
4870 // CHECK41: omp.inner.for.end:
4871 // CHECK41-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4872 // CHECK41-NEXT: [[SUB6:%.*]] = sub nsw i32 [[TMP13]], 0
4873 // CHECK41-NEXT: [[DIV7:%.*]] = sdiv i32 [[SUB6]], 1
4874 // CHECK41-NEXT: [[MUL8:%.*]] = mul nsw i32 [[DIV7]], 1
4875 // CHECK41-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
4876 // CHECK41-NEXT: store i32 [[ADD9]], ptr [[I3]], align 4
4877 // CHECK41-NEXT: br label [[SIMD_IF_END]]
4878 // CHECK41: simd.if.end:
4879 // CHECK41-NEXT: [[TMP14:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4880 // CHECK41-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP14]])
4881 // CHECK41-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
4882 // CHECK41-NEXT: [[TMP15:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
4883 // CHECK41-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP15]])
4884 // CHECK41-NEXT: [[TMP16:%.*]] = load i32, ptr [[RETVAL]], align 4
4885 // CHECK41-NEXT: ret i32 [[TMP16]]
4888 // CHECK41-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
4889 // CHECK41-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR2:[0-9]+]] comdat {
4890 // CHECK41-NEXT: entry:
4891 // CHECK41-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4892 // CHECK41-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
4893 // CHECK41-NEXT: [[TE:%.*]] = alloca i32, align 4
4894 // CHECK41-NEXT: [[TH:%.*]] = alloca i32, align 4
4895 // CHECK41-NEXT: [[TMP:%.*]] = alloca i32, align 4
4896 // CHECK41-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4897 // CHECK41-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4898 // CHECK41-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4899 // CHECK41-NEXT: [[I:%.*]] = alloca i32, align 4
4900 // CHECK41-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4901 // CHECK41-NEXT: store i32 0, ptr [[TE]], align 4
4902 // CHECK41-NEXT: store i32 128, ptr [[TH]], align 4
4903 // CHECK41-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4904 // CHECK41-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
4905 // CHECK41-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4906 // CHECK41-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
4907 // CHECK41-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4908 // CHECK41: omp.inner.for.cond:
4909 // CHECK41-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
4910 // CHECK41-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP6]]
4911 // CHECK41-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
4912 // CHECK41-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4913 // CHECK41: omp.inner.for.body:
4914 // CHECK41-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4915 // CHECK41-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
4916 // CHECK41-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4917 // CHECK41-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP6]]
4918 // CHECK41-NEXT: [[TMP4:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP6]]
4919 // CHECK41-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP4]] to i64
4920 // CHECK41-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
4921 // CHECK41-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP6]]
4922 // CHECK41-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4923 // CHECK41: omp.body.continue:
4924 // CHECK41-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4925 // CHECK41: omp.inner.for.inc:
4926 // CHECK41-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4927 // CHECK41-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP5]], 1
4928 // CHECK41-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4929 // CHECK41-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
4930 // CHECK41: omp.inner.for.end:
4931 // CHECK41-NEXT: store i32 10, ptr [[I]], align 4
4932 // CHECK41-NEXT: ret i32 0
4935 // CHECK43-LABEL: define {{[^@]+}}@main
4936 // CHECK43-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
4937 // CHECK43-NEXT: entry:
4938 // CHECK43-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
4939 // CHECK43-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4940 // CHECK43-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
4941 // CHECK43-NEXT: [[N:%.*]] = alloca i32, align 4
4942 // CHECK43-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
4943 // CHECK43-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
4944 // CHECK43-NEXT: [[TMP:%.*]] = alloca i32, align 4
4945 // CHECK43-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
4946 // CHECK43-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
4947 // CHECK43-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4948 // CHECK43-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4949 // CHECK43-NEXT: [[I:%.*]] = alloca i32, align 4
4950 // CHECK43-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4951 // CHECK43-NEXT: [[I3:%.*]] = alloca i32, align 4
4952 // CHECK43-NEXT: store i32 0, ptr [[RETVAL]], align 4
4953 // CHECK43-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4954 // CHECK43-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
4955 // CHECK43-NEXT: store i32 100, ptr [[N]], align 4
4956 // CHECK43-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
4957 // CHECK43-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
4958 // CHECK43-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
4959 // CHECK43-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
4960 // CHECK43-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
4961 // CHECK43-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
4962 // CHECK43-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
4963 // CHECK43-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4964 // CHECK43-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
4965 // CHECK43-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4966 // CHECK43-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
4967 // CHECK43-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4968 // CHECK43-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4969 // CHECK43-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4970 // CHECK43-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_UB]], align 4
4971 // CHECK43-NEXT: store i32 0, ptr [[I]], align 4
4972 // CHECK43-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4973 // CHECK43-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
4974 // CHECK43-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
4975 // CHECK43: simd.if.then:
4976 // CHECK43-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4977 // CHECK43-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
4978 // CHECK43-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4979 // CHECK43: omp.inner.for.cond:
4980 // CHECK43-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
4981 // CHECK43-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
4982 // CHECK43-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
4983 // CHECK43-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4984 // CHECK43: omp.inner.for.body:
4985 // CHECK43-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
4986 // CHECK43-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
4987 // CHECK43-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4988 // CHECK43-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP3]]
4989 // CHECK43-NEXT: [[TMP10:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP3]]
4990 // CHECK43-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 [[TMP10]]
4991 // CHECK43-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
4992 // CHECK43-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4993 // CHECK43: omp.body.continue:
4994 // CHECK43-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4995 // CHECK43: omp.inner.for.inc:
4996 // CHECK43-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
4997 // CHECK43-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP11]], 1
4998 // CHECK43-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
4999 // CHECK43-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
5000 // CHECK43: omp.inner.for.end:
5001 // CHECK43-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
5002 // CHECK43-NEXT: [[SUB6:%.*]] = sub nsw i32 [[TMP12]], 0
5003 // CHECK43-NEXT: [[DIV7:%.*]] = sdiv i32 [[SUB6]], 1
5004 // CHECK43-NEXT: [[MUL8:%.*]] = mul nsw i32 [[DIV7]], 1
5005 // CHECK43-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
5006 // CHECK43-NEXT: store i32 [[ADD9]], ptr [[I3]], align 4
5007 // CHECK43-NEXT: br label [[SIMD_IF_END]]
5008 // CHECK43: simd.if.end:
5009 // CHECK43-NEXT: [[TMP13:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5010 // CHECK43-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP13]])
5011 // CHECK43-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
5012 // CHECK43-NEXT: [[TMP14:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
5013 // CHECK43-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP14]])
5014 // CHECK43-NEXT: [[TMP15:%.*]] = load i32, ptr [[RETVAL]], align 4
5015 // CHECK43-NEXT: ret i32 [[TMP15]]
5018 // CHECK43-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
5019 // CHECK43-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR2:[0-9]+]] comdat {
5020 // CHECK43-NEXT: entry:
5021 // CHECK43-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5022 // CHECK43-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
5023 // CHECK43-NEXT: [[TE:%.*]] = alloca i32, align 4
5024 // CHECK43-NEXT: [[TH:%.*]] = alloca i32, align 4
5025 // CHECK43-NEXT: [[TMP:%.*]] = alloca i32, align 4
5026 // CHECK43-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5027 // CHECK43-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5028 // CHECK43-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5029 // CHECK43-NEXT: [[I:%.*]] = alloca i32, align 4
5030 // CHECK43-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5031 // CHECK43-NEXT: store i32 0, ptr [[TE]], align 4
5032 // CHECK43-NEXT: store i32 128, ptr [[TH]], align 4
5033 // CHECK43-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5034 // CHECK43-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
5035 // CHECK43-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5036 // CHECK43-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
5037 // CHECK43-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5038 // CHECK43: omp.inner.for.cond:
5039 // CHECK43-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP7:![0-9]+]]
5040 // CHECK43-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP7]]
5041 // CHECK43-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
5042 // CHECK43-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5043 // CHECK43: omp.inner.for.body:
5044 // CHECK43-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP7]]
5045 // CHECK43-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
5046 // CHECK43-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5047 // CHECK43-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP7]]
5048 // CHECK43-NEXT: [[TMP4:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP7]]
5049 // CHECK43-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[A]], i32 0, i32 [[TMP4]]
5050 // CHECK43-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP7]]
5051 // CHECK43-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5052 // CHECK43: omp.body.continue:
5053 // CHECK43-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5054 // CHECK43: omp.inner.for.inc:
5055 // CHECK43-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP7]]
5056 // CHECK43-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP5]], 1
5057 // CHECK43-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP7]]
5058 // CHECK43-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP8:![0-9]+]]
5059 // CHECK43: omp.inner.for.end:
5060 // CHECK43-NEXT: store i32 10, ptr [[I]], align 4
5061 // CHECK43-NEXT: ret i32 0
5064 // CHECK45-LABEL: define {{[^@]+}}@main
5065 // CHECK45-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
5066 // CHECK45-NEXT: entry:
5067 // CHECK45-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
5068 // CHECK45-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5069 // CHECK45-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
5070 // CHECK45-NEXT: [[N:%.*]] = alloca i32, align 4
5071 // CHECK45-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
5072 // CHECK45-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
5073 // CHECK45-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
5074 // CHECK45-NEXT: [[TMP:%.*]] = alloca i32, align 4
5075 // CHECK45-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
5076 // CHECK45-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
5077 // CHECK45-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5078 // CHECK45-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5079 // CHECK45-NEXT: [[I:%.*]] = alloca i32, align 4
5080 // CHECK45-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5081 // CHECK45-NEXT: [[I4:%.*]] = alloca i32, align 4
5082 // CHECK45-NEXT: store i32 0, ptr [[RETVAL]], align 4
5083 // CHECK45-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5084 // CHECK45-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
5085 // CHECK45-NEXT: store i32 100, ptr [[N]], align 4
5086 // CHECK45-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
5087 // CHECK45-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
5088 // CHECK45-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
5089 // CHECK45-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
5090 // CHECK45-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
5091 // CHECK45-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
5092 // CHECK45-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5093 // CHECK45-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP3]], 0
5094 // CHECK45-NEXT: [[STOREDV:%.*]] = zext i1 [[TOBOOL]] to i8
5095 // CHECK45-NEXT: store i8 [[STOREDV]], ptr [[DOTCAPTURE_EXPR_]], align 1
5096 // CHECK45-NEXT: [[TMP4:%.*]] = load i32, ptr [[N]], align 4
5097 // CHECK45-NEXT: store i32 [[TMP4]], ptr [[DOTCAPTURE_EXPR_1]], align 4
5098 // CHECK45-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5099 // CHECK45-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP5]], 0
5100 // CHECK45-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
5101 // CHECK45-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
5102 // CHECK45-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
5103 // CHECK45-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5104 // CHECK45-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
5105 // CHECK45-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
5106 // CHECK45-NEXT: store i32 0, ptr [[I]], align 4
5107 // CHECK45-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5108 // CHECK45-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP7]]
5109 // CHECK45-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
5110 // CHECK45: simd.if.then:
5111 // CHECK45-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5112 // CHECK45-NEXT: store i32 [[TMP8]], ptr [[DOTOMP_IV]], align 4
5113 // CHECK45-NEXT: [[TMP9:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
5114 // CHECK45-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP9]] to i1
5115 // CHECK45-NEXT: br i1 [[LOADEDV]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
5116 // CHECK45: omp_if.then:
5117 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5118 // CHECK45: omp.inner.for.cond:
5119 // CHECK45-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
5120 // CHECK45-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
5121 // CHECK45-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP10]], [[TMP11]]
5122 // CHECK45-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5123 // CHECK45: omp.inner.for.body:
5124 // CHECK45-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
5125 // CHECK45-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP12]], 1
5126 // CHECK45-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5127 // CHECK45-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP2]]
5128 // CHECK45-NEXT: [[TMP13:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP2]]
5129 // CHECK45-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP13]] to i64
5130 // CHECK45-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 [[IDXPROM]]
5131 // CHECK45-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
5132 // CHECK45-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5133 // CHECK45: omp.body.continue:
5134 // CHECK45-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5135 // CHECK45: omp.inner.for.inc:
5136 // CHECK45-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
5137 // CHECK45-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP14]], 1
5138 // CHECK45-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
5139 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
5140 // CHECK45: omp.inner.for.end:
5141 // CHECK45-NEXT: br label [[OMP_IF_END:%.*]]
5142 // CHECK45: omp_if.else:
5143 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
5144 // CHECK45: omp.inner.for.cond7:
5145 // CHECK45-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5146 // CHECK45-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5147 // CHECK45-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
5148 // CHECK45-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
5149 // CHECK45: omp.inner.for.body9:
5150 // CHECK45-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5151 // CHECK45-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP17]], 1
5152 // CHECK45-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
5153 // CHECK45-NEXT: store i32 [[ADD11]], ptr [[I4]], align 4
5154 // CHECK45-NEXT: [[TMP18:%.*]] = load i32, ptr [[I4]], align 4
5155 // CHECK45-NEXT: [[IDXPROM12:%.*]] = sext i32 [[TMP18]] to i64
5156 // CHECK45-NEXT: [[ARRAYIDX13:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 [[IDXPROM12]]
5157 // CHECK45-NEXT: store i32 0, ptr [[ARRAYIDX13]], align 4
5158 // CHECK45-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
5159 // CHECK45: omp.body.continue14:
5160 // CHECK45-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
5161 // CHECK45: omp.inner.for.inc15:
5162 // CHECK45-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5163 // CHECK45-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP19]], 1
5164 // CHECK45-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
5165 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP6:![0-9]+]]
5166 // CHECK45: omp.inner.for.end17:
5167 // CHECK45-NEXT: br label [[OMP_IF_END]]
5168 // CHECK45: omp_if.end:
5169 // CHECK45-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5170 // CHECK45-NEXT: [[SUB18:%.*]] = sub nsw i32 [[TMP20]], 0
5171 // CHECK45-NEXT: [[DIV19:%.*]] = sdiv i32 [[SUB18]], 1
5172 // CHECK45-NEXT: [[MUL20:%.*]] = mul nsw i32 [[DIV19]], 1
5173 // CHECK45-NEXT: [[ADD21:%.*]] = add nsw i32 0, [[MUL20]]
5174 // CHECK45-NEXT: store i32 [[ADD21]], ptr [[I4]], align 4
5175 // CHECK45-NEXT: br label [[SIMD_IF_END]]
5176 // CHECK45: simd.if.end:
5177 // CHECK45-NEXT: [[TMP21:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5178 // CHECK45-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP21]])
5179 // CHECK45-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
5180 // CHECK45-NEXT: [[TMP22:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
5181 // CHECK45-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP22]])
5182 // CHECK45-NEXT: [[TMP23:%.*]] = load i32, ptr [[RETVAL]], align 4
5183 // CHECK45-NEXT: ret i32 [[TMP23]]
5186 // CHECK45-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
5187 // CHECK45-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR2:[0-9]+]] comdat {
5188 // CHECK45-NEXT: entry:
5189 // CHECK45-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5190 // CHECK45-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
5191 // CHECK45-NEXT: [[TE:%.*]] = alloca i32, align 4
5192 // CHECK45-NEXT: [[TH:%.*]] = alloca i32, align 4
5193 // CHECK45-NEXT: [[TMP:%.*]] = alloca i32, align 4
5194 // CHECK45-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5195 // CHECK45-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5196 // CHECK45-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5197 // CHECK45-NEXT: [[I:%.*]] = alloca i32, align 4
5198 // CHECK45-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5199 // CHECK45-NEXT: store i32 0, ptr [[TE]], align 4
5200 // CHECK45-NEXT: store i32 128, ptr [[TH]], align 4
5201 // CHECK45-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5202 // CHECK45-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
5203 // CHECK45-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5204 // CHECK45-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
5205 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5206 // CHECK45: omp.inner.for.cond:
5207 // CHECK45-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8:![0-9]+]]
5208 // CHECK45-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP8]]
5209 // CHECK45-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
5210 // CHECK45-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5211 // CHECK45: omp.inner.for.body:
5212 // CHECK45-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8]]
5213 // CHECK45-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
5214 // CHECK45-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5215 // CHECK45-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP8]]
5216 // CHECK45-NEXT: [[TMP4:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP8]]
5217 // CHECK45-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP4]] to i64
5218 // CHECK45-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
5219 // CHECK45-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP8]]
5220 // CHECK45-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5221 // CHECK45: omp.body.continue:
5222 // CHECK45-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5223 // CHECK45: omp.inner.for.inc:
5224 // CHECK45-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8]]
5225 // CHECK45-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP5]], 1
5226 // CHECK45-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8]]
5227 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP9:![0-9]+]]
5228 // CHECK45: omp.inner.for.end:
5229 // CHECK45-NEXT: store i32 10, ptr [[I]], align 4
5230 // CHECK45-NEXT: ret i32 0
5233 // CHECK47-LABEL: define {{[^@]+}}@main
5234 // CHECK47-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
5235 // CHECK47-NEXT: entry:
5236 // CHECK47-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
5237 // CHECK47-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5238 // CHECK47-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
5239 // CHECK47-NEXT: [[N:%.*]] = alloca i32, align 4
5240 // CHECK47-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
5241 // CHECK47-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
5242 // CHECK47-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
5243 // CHECK47-NEXT: [[TMP:%.*]] = alloca i32, align 4
5244 // CHECK47-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
5245 // CHECK47-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
5246 // CHECK47-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5247 // CHECK47-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5248 // CHECK47-NEXT: [[I:%.*]] = alloca i32, align 4
5249 // CHECK47-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5250 // CHECK47-NEXT: [[I4:%.*]] = alloca i32, align 4
5251 // CHECK47-NEXT: store i32 0, ptr [[RETVAL]], align 4
5252 // CHECK47-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5253 // CHECK47-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
5254 // CHECK47-NEXT: store i32 100, ptr [[N]], align 4
5255 // CHECK47-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
5256 // CHECK47-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
5257 // CHECK47-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
5258 // CHECK47-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
5259 // CHECK47-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
5260 // CHECK47-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5261 // CHECK47-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP2]], 0
5262 // CHECK47-NEXT: [[STOREDV:%.*]] = zext i1 [[TOBOOL]] to i8
5263 // CHECK47-NEXT: store i8 [[STOREDV]], ptr [[DOTCAPTURE_EXPR_]], align 1
5264 // CHECK47-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
5265 // CHECK47-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
5266 // CHECK47-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5267 // CHECK47-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
5268 // CHECK47-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
5269 // CHECK47-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
5270 // CHECK47-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
5271 // CHECK47-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5272 // CHECK47-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
5273 // CHECK47-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
5274 // CHECK47-NEXT: store i32 0, ptr [[I]], align 4
5275 // CHECK47-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5276 // CHECK47-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP6]]
5277 // CHECK47-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
5278 // CHECK47: simd.if.then:
5279 // CHECK47-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5280 // CHECK47-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
5281 // CHECK47-NEXT: [[TMP8:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
5282 // CHECK47-NEXT: [[LOADEDV:%.*]] = trunc i8 [[TMP8]] to i1
5283 // CHECK47-NEXT: br i1 [[LOADEDV]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
5284 // CHECK47: omp_if.then:
5285 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5286 // CHECK47: omp.inner.for.cond:
5287 // CHECK47-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
5288 // CHECK47-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
5289 // CHECK47-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
5290 // CHECK47-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5291 // CHECK47: omp.inner.for.body:
5292 // CHECK47-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
5293 // CHECK47-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
5294 // CHECK47-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5295 // CHECK47-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP3]]
5296 // CHECK47-NEXT: [[TMP12:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP3]]
5297 // CHECK47-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 [[TMP12]]
5298 // CHECK47-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
5299 // CHECK47-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5300 // CHECK47: omp.body.continue:
5301 // CHECK47-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5302 // CHECK47: omp.inner.for.inc:
5303 // CHECK47-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
5304 // CHECK47-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP13]], 1
5305 // CHECK47-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
5306 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
5307 // CHECK47: omp.inner.for.end:
5308 // CHECK47-NEXT: br label [[OMP_IF_END:%.*]]
5309 // CHECK47: omp_if.else:
5310 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
5311 // CHECK47: omp.inner.for.cond7:
5312 // CHECK47-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5313 // CHECK47-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5314 // CHECK47-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
5315 // CHECK47-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END16:%.*]]
5316 // CHECK47: omp.inner.for.body9:
5317 // CHECK47-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5318 // CHECK47-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP16]], 1
5319 // CHECK47-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
5320 // CHECK47-NEXT: store i32 [[ADD11]], ptr [[I4]], align 4
5321 // CHECK47-NEXT: [[TMP17:%.*]] = load i32, ptr [[I4]], align 4
5322 // CHECK47-NEXT: [[ARRAYIDX12:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 [[TMP17]]
5323 // CHECK47-NEXT: store i32 0, ptr [[ARRAYIDX12]], align 4
5324 // CHECK47-NEXT: br label [[OMP_BODY_CONTINUE13:%.*]]
5325 // CHECK47: omp.body.continue13:
5326 // CHECK47-NEXT: br label [[OMP_INNER_FOR_INC14:%.*]]
5327 // CHECK47: omp.inner.for.inc14:
5328 // CHECK47-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5329 // CHECK47-NEXT: [[ADD15:%.*]] = add nsw i32 [[TMP18]], 1
5330 // CHECK47-NEXT: store i32 [[ADD15]], ptr [[DOTOMP_IV]], align 4
5331 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP7:![0-9]+]]
5332 // CHECK47: omp.inner.for.end16:
5333 // CHECK47-NEXT: br label [[OMP_IF_END]]
5334 // CHECK47: omp_if.end:
5335 // CHECK47-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5336 // CHECK47-NEXT: [[SUB17:%.*]] = sub nsw i32 [[TMP19]], 0
5337 // CHECK47-NEXT: [[DIV18:%.*]] = sdiv i32 [[SUB17]], 1
5338 // CHECK47-NEXT: [[MUL19:%.*]] = mul nsw i32 [[DIV18]], 1
5339 // CHECK47-NEXT: [[ADD20:%.*]] = add nsw i32 0, [[MUL19]]
5340 // CHECK47-NEXT: store i32 [[ADD20]], ptr [[I4]], align 4
5341 // CHECK47-NEXT: br label [[SIMD_IF_END]]
5342 // CHECK47: simd.if.end:
5343 // CHECK47-NEXT: [[TMP20:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5344 // CHECK47-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP20]])
5345 // CHECK47-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
5346 // CHECK47-NEXT: [[TMP21:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
5347 // CHECK47-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP21]])
5348 // CHECK47-NEXT: [[TMP22:%.*]] = load i32, ptr [[RETVAL]], align 4
5349 // CHECK47-NEXT: ret i32 [[TMP22]]
5352 // CHECK47-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
5353 // CHECK47-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR2:[0-9]+]] comdat {
5354 // CHECK47-NEXT: entry:
5355 // CHECK47-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5356 // CHECK47-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
5357 // CHECK47-NEXT: [[TE:%.*]] = alloca i32, align 4
5358 // CHECK47-NEXT: [[TH:%.*]] = alloca i32, align 4
5359 // CHECK47-NEXT: [[TMP:%.*]] = alloca i32, align 4
5360 // CHECK47-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5361 // CHECK47-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5362 // CHECK47-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5363 // CHECK47-NEXT: [[I:%.*]] = alloca i32, align 4
5364 // CHECK47-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5365 // CHECK47-NEXT: store i32 0, ptr [[TE]], align 4
5366 // CHECK47-NEXT: store i32 128, ptr [[TH]], align 4
5367 // CHECK47-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5368 // CHECK47-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
5369 // CHECK47-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5370 // CHECK47-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
5371 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5372 // CHECK47: omp.inner.for.cond:
5373 // CHECK47-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
5374 // CHECK47-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
5375 // CHECK47-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
5376 // CHECK47-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5377 // CHECK47: omp.inner.for.body:
5378 // CHECK47-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
5379 // CHECK47-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
5380 // CHECK47-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5381 // CHECK47-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
5382 // CHECK47-NEXT: [[TMP4:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
5383 // CHECK47-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[A]], i32 0, i32 [[TMP4]]
5384 // CHECK47-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP9]]
5385 // CHECK47-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5386 // CHECK47: omp.body.continue:
5387 // CHECK47-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5388 // CHECK47: omp.inner.for.inc:
5389 // CHECK47-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
5390 // CHECK47-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP5]], 1
5391 // CHECK47-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
5392 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
5393 // CHECK47: omp.inner.for.end:
5394 // CHECK47-NEXT: store i32 10, ptr [[I]], align 4
5395 // CHECK47-NEXT: ret i32 0