Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / teams_distribute_simd_codegen.cpp
blob751bb6ca35ba8445c59a05e7649b5d6339c0120d
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
3 #ifndef HEADER
4 #define HEADER
5 // Test host codegen.
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
19 #ifdef CK1
21 int a[100];
23 int teams_argument_global(int n) {
24 int i;
25 int te = n / 128;
26 int th = 128;
27 // discard n_addr and i
30 #pragma omp target
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++) {
33 a[i] = 0;
36 #pragma omp target
37 {{{
38 #pragma omp teams distribute simd safelen(32)
39 for(int i = 0; i < n; i++) {
40 a[i] = 0;
42 }}}
44 // outlined target regions
49 return a[0];
53 #endif // CK1
55 // Test host codegen.
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
69 #ifdef CK2
71 int teams_local_arg(void) {
72 int n = 100;
73 int a[n];
75 #pragma omp target
76 #pragma omp teams distribute simd
77 for(int i = 0; i < n; i++) {
78 a[i] = 0;
81 // outlined target region
84 return a[0];
86 #endif // CK2
88 // Test host codegen.
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
114 #ifdef CK3
117 template <typename T, int X, long long Y>
118 struct SS{
119 T a[X];
120 float b;
121 int foo(void) {
123 #pragma omp target
124 #ifdef OMP5
125 #pragma omp teams distribute simd if(b) nontemporal(a, b)
126 #else
127 #pragma omp teams distribute simd
128 #endif // OMP5
129 for(int i = 0; i < X; i++) {
130 a[i] = (T)b;
133 // outlined target region
136 return a[0];
140 int teams_template_struct(void) {
141 SS<int, 123, 456> V;
142 return V.foo();
145 #endif // CK3
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
174 #ifdef CK4
176 template <typename T, int n>
177 int tmain(T argc) {
178 T a[n];
179 int te = n/128;
180 int th = 128;
181 #pragma omp target
182 #pragma omp teams distribute simd num_teams(te) thread_limit(th)
183 for(int i = 0; i < n; i++) {
184 a[i] = (T)0;
186 return 0;
189 int main (int argc, char **argv) {
190 int n = 100;
191 int a[n];
192 #pragma omp target
193 #ifdef OMP5
194 #pragma omp teams distribute simd if(simd:argc)
195 #else
196 #pragma omp teams distribute simd
197 #endif // OMP5
198 for(int i = 0; i < n; i++) {
199 a[i] = 0;
201 return tmain<int, 10>(argc);
210 // OMP5_50-DAG: !{!"llvm.loop.vectorize.enable", i1 false}
211 #endif // CK4
212 #endif
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 [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
305 // CHECK1-NEXT: store i32 2, ptr [[TMP36]], align 4
306 // CHECK1-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
365 // CHECK1-NEXT: store i32 2, ptr [[TMP65]], align 4
366 // CHECK1-NEXT: [[TMP66:%.*]] = getelementptr inbounds [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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 [[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]]
481 // CHECK1: 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]]
597 // CHECK1: 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 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
649 // CHECK1-SAME: () #[[ATTR4:[0-9]+]] {
650 // CHECK1-NEXT: entry:
651 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
652 // CHECK1-NEXT: ret void
655 // CHECK3-LABEL: define {{[^@]+}}@_Z21teams_argument_globali
656 // CHECK3-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0:[0-9]+]] {
657 // CHECK3-NEXT: entry:
658 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
659 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
660 // CHECK3-NEXT: [[TE:%.*]] = alloca i32, align 4
661 // CHECK3-NEXT: [[TH:%.*]] = alloca i32, align 4
662 // CHECK3-NEXT: [[TE_CASTED:%.*]] = alloca i32, align 4
663 // CHECK3-NEXT: [[TH_CASTED:%.*]] = alloca i32, align 4
664 // CHECK3-NEXT: [[I_CASTED:%.*]] = alloca i32, align 4
665 // CHECK3-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
666 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [5 x ptr], align 4
667 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [5 x ptr], align 4
668 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [5 x ptr], align 4
669 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
670 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
671 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
672 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
673 // CHECK3-NEXT: [[N_CASTED4:%.*]] = alloca i32, align 4
674 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS5:%.*]] = alloca [2 x ptr], align 4
675 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS6:%.*]] = alloca [2 x ptr], align 4
676 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS7:%.*]] = alloca [2 x ptr], align 4
677 // CHECK3-NEXT: [[_TMP8:%.*]] = alloca i32, align 4
678 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32, align 4
679 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_10:%.*]] = alloca i32, align 4
680 // CHECK3-NEXT: [[KERNEL_ARGS15:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
681 // CHECK3-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
682 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[N_ADDR]], align 4
683 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP0]], 128
684 // CHECK3-NEXT: store i32 [[DIV]], ptr [[TE]], align 4
685 // CHECK3-NEXT: store i32 128, ptr [[TH]], align 4
686 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE]], align 4
687 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[TE_CASTED]], align 4
688 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_CASTED]], align 4
689 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH]], align 4
690 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[TH_CASTED]], align 4
691 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[TH_CASTED]], align 4
692 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4
693 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[I_CASTED]], align 4
694 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[I_CASTED]], align 4
695 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[N_ADDR]], align 4
696 // CHECK3-NEXT: store i32 [[TMP7]], ptr [[N_CASTED]], align 4
697 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[N_CASTED]], align 4
698 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
699 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[TMP9]], align 4
700 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
701 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[TMP10]], align 4
702 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
703 // CHECK3-NEXT: store ptr null, ptr [[TMP11]], align 4
704 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
705 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[TMP12]], align 4
706 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
707 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[TMP13]], align 4
708 // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
709 // CHECK3-NEXT: store ptr null, ptr [[TMP14]], align 4
710 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
711 // CHECK3-NEXT: store ptr @a, ptr [[TMP15]], align 4
712 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
713 // CHECK3-NEXT: store ptr @a, ptr [[TMP16]], align 4
714 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
715 // CHECK3-NEXT: store ptr null, ptr [[TMP17]], align 4
716 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
717 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[TMP18]], align 4
718 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
719 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[TMP19]], align 4
720 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 3
721 // CHECK3-NEXT: store ptr null, ptr [[TMP20]], align 4
722 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 4
723 // CHECK3-NEXT: store i32 [[TMP8]], ptr [[TMP21]], align 4
724 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 4
725 // CHECK3-NEXT: store i32 [[TMP8]], ptr [[TMP22]], align 4
726 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 4
727 // CHECK3-NEXT: store ptr null, ptr [[TMP23]], align 4
728 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
729 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [5 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
730 // CHECK3-NEXT: [[TMP26:%.*]] = load i32, ptr [[TE]], align 4
731 // CHECK3-NEXT: [[TMP27:%.*]] = load i32, ptr [[TH]], align 4
732 // CHECK3-NEXT: [[TMP28:%.*]] = icmp ult i32 [[TMP27]], 1
733 // CHECK3-NEXT: [[TMP29:%.*]] = select i1 [[TMP28]], i32 [[TMP27]], i32 1
734 // CHECK3-NEXT: [[TMP30:%.*]] = load i32, ptr [[N_ADDR]], align 4
735 // CHECK3-NEXT: store i32 [[TMP30]], ptr [[DOTCAPTURE_EXPR_]], align 4
736 // CHECK3-NEXT: [[TMP31:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
737 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP31]], 0
738 // CHECK3-NEXT: [[DIV2:%.*]] = sdiv i32 [[SUB]], 1
739 // CHECK3-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV2]], 1
740 // CHECK3-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
741 // CHECK3-NEXT: [[TMP32:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
742 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP32]], 1
743 // CHECK3-NEXT: [[TMP33:%.*]] = zext i32 [[ADD]] to i64
744 // CHECK3-NEXT: [[TMP34:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP26]], 0
745 // CHECK3-NEXT: [[TMP35:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP29]], 0
746 // CHECK3-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
747 // CHECK3-NEXT: store i32 2, ptr [[TMP36]], align 4
748 // CHECK3-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
749 // CHECK3-NEXT: store i32 5, ptr [[TMP37]], align 4
750 // CHECK3-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
751 // CHECK3-NEXT: store ptr [[TMP24]], ptr [[TMP38]], align 4
752 // CHECK3-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
753 // CHECK3-NEXT: store ptr [[TMP25]], ptr [[TMP39]], align 4
754 // CHECK3-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
755 // CHECK3-NEXT: store ptr @.offload_sizes, ptr [[TMP40]], align 4
756 // CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
757 // CHECK3-NEXT: store ptr @.offload_maptypes, ptr [[TMP41]], align 4
758 // CHECK3-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
759 // CHECK3-NEXT: store ptr null, ptr [[TMP42]], align 4
760 // CHECK3-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
761 // CHECK3-NEXT: store ptr null, ptr [[TMP43]], align 4
762 // CHECK3-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
763 // CHECK3-NEXT: store i64 [[TMP33]], ptr [[TMP44]], align 8
764 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
765 // CHECK3-NEXT: store i64 0, ptr [[TMP45]], align 8
766 // CHECK3-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
767 // CHECK3-NEXT: store [3 x i32] [[TMP34]], ptr [[TMP46]], align 4
768 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
769 // CHECK3-NEXT: store [3 x i32] [[TMP35]], ptr [[TMP47]], align 4
770 // CHECK3-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
771 // CHECK3-NEXT: store i32 0, ptr [[TMP48]], align 4
772 // 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]])
773 // CHECK3-NEXT: [[TMP50:%.*]] = icmp ne i32 [[TMP49]], 0
774 // CHECK3-NEXT: br i1 [[TMP50]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
775 // CHECK3: omp_offload.failed:
776 // 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]+]]
777 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
778 // CHECK3: omp_offload.cont:
779 // CHECK3-NEXT: [[TMP51:%.*]] = load i32, ptr [[N_ADDR]], align 4
780 // CHECK3-NEXT: store i32 [[TMP51]], ptr [[N_CASTED4]], align 4
781 // CHECK3-NEXT: [[TMP52:%.*]] = load i32, ptr [[N_CASTED4]], align 4
782 // CHECK3-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
783 // CHECK3-NEXT: store i32 [[TMP52]], ptr [[TMP53]], align 4
784 // CHECK3-NEXT: [[TMP54:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
785 // CHECK3-NEXT: store i32 [[TMP52]], ptr [[TMP54]], align 4
786 // CHECK3-NEXT: [[TMP55:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i32 0, i32 0
787 // CHECK3-NEXT: store ptr null, ptr [[TMP55]], align 4
788 // CHECK3-NEXT: [[TMP56:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 1
789 // CHECK3-NEXT: store ptr @a, ptr [[TMP56]], align 4
790 // CHECK3-NEXT: [[TMP57:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 1
791 // CHECK3-NEXT: store ptr @a, ptr [[TMP57]], align 4
792 // CHECK3-NEXT: [[TMP58:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i32 0, i32 1
793 // CHECK3-NEXT: store ptr null, ptr [[TMP58]], align 4
794 // CHECK3-NEXT: [[TMP59:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
795 // CHECK3-NEXT: [[TMP60:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
796 // CHECK3-NEXT: [[TMP61:%.*]] = load i32, ptr [[N_ADDR]], align 4
797 // CHECK3-NEXT: store i32 [[TMP61]], ptr [[DOTCAPTURE_EXPR_9]], align 4
798 // CHECK3-NEXT: [[TMP62:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_9]], align 4
799 // CHECK3-NEXT: [[SUB11:%.*]] = sub nsw i32 [[TMP62]], 0
800 // CHECK3-NEXT: [[DIV12:%.*]] = sdiv i32 [[SUB11]], 1
801 // CHECK3-NEXT: [[SUB13:%.*]] = sub nsw i32 [[DIV12]], 1
802 // CHECK3-NEXT: store i32 [[SUB13]], ptr [[DOTCAPTURE_EXPR_10]], align 4
803 // CHECK3-NEXT: [[TMP63:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_10]], align 4
804 // CHECK3-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP63]], 1
805 // CHECK3-NEXT: [[TMP64:%.*]] = zext i32 [[ADD14]] to i64
806 // CHECK3-NEXT: [[TMP65:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
807 // CHECK3-NEXT: store i32 2, ptr [[TMP65]], align 4
808 // CHECK3-NEXT: [[TMP66:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 1
809 // CHECK3-NEXT: store i32 2, ptr [[TMP66]], align 4
810 // CHECK3-NEXT: [[TMP67:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 2
811 // CHECK3-NEXT: store ptr [[TMP59]], ptr [[TMP67]], align 4
812 // CHECK3-NEXT: [[TMP68:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 3
813 // CHECK3-NEXT: store ptr [[TMP60]], ptr [[TMP68]], align 4
814 // CHECK3-NEXT: [[TMP69:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 4
815 // CHECK3-NEXT: store ptr @.offload_sizes.1, ptr [[TMP69]], align 4
816 // CHECK3-NEXT: [[TMP70:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 5
817 // CHECK3-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP70]], align 4
818 // CHECK3-NEXT: [[TMP71:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 6
819 // CHECK3-NEXT: store ptr null, ptr [[TMP71]], align 4
820 // CHECK3-NEXT: [[TMP72:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 7
821 // CHECK3-NEXT: store ptr null, ptr [[TMP72]], align 4
822 // CHECK3-NEXT: [[TMP73:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 8
823 // CHECK3-NEXT: store i64 [[TMP64]], ptr [[TMP73]], align 8
824 // CHECK3-NEXT: [[TMP74:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 9
825 // CHECK3-NEXT: store i64 0, ptr [[TMP74]], align 8
826 // CHECK3-NEXT: [[TMP75:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 10
827 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP75]], align 4
828 // CHECK3-NEXT: [[TMP76:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 11
829 // CHECK3-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP76]], align 4
830 // CHECK3-NEXT: [[TMP77:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 12
831 // CHECK3-NEXT: store i32 0, ptr [[TMP77]], align 4
832 // 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]])
833 // CHECK3-NEXT: [[TMP79:%.*]] = icmp ne i32 [[TMP78]], 0
834 // CHECK3-NEXT: br i1 [[TMP79]], label [[OMP_OFFLOAD_FAILED16:%.*]], label [[OMP_OFFLOAD_CONT17:%.*]]
835 // CHECK3: omp_offload.failed16:
836 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36(i32 [[TMP52]], ptr @a) #[[ATTR3]]
837 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT17]]
838 // CHECK3: omp_offload.cont17:
839 // CHECK3-NEXT: [[TMP80:%.*]] = load i32, ptr @a, align 4
840 // CHECK3-NEXT: ret i32 [[TMP80]]
843 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30
844 // 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]+]] {
845 // CHECK3-NEXT: entry:
846 // CHECK3-NEXT: [[TE_ADDR:%.*]] = alloca i32, align 4
847 // CHECK3-NEXT: [[TH_ADDR:%.*]] = alloca i32, align 4
848 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
849 // CHECK3-NEXT: [[I_ADDR:%.*]] = alloca i32, align 4
850 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
851 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
852 // CHECK3-NEXT: store i32 [[TE]], ptr [[TE_ADDR]], align 4
853 // CHECK3-NEXT: store i32 [[TH]], ptr [[TH_ADDR]], align 4
854 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
855 // CHECK3-NEXT: store i32 [[I]], ptr [[I_ADDR]], align 4
856 // CHECK3-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
857 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
858 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
859 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
860 // CHECK3-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
861 // 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]])
862 // CHECK3-NEXT: ret void
865 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l30.omp_outlined
866 // 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]] {
867 // CHECK3-NEXT: entry:
868 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
869 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
870 // CHECK3-NEXT: [[I_ADDR:%.*]] = alloca ptr, align 4
871 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
872 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
873 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
874 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
875 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
876 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
877 // CHECK3-NEXT: [[I3:%.*]] = alloca i32, align 4
878 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
879 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
880 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
881 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
882 // CHECK3-NEXT: [[I4:%.*]] = alloca i32, align 4
883 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
884 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
885 // CHECK3-NEXT: store ptr [[I]], ptr [[I_ADDR]], align 4
886 // CHECK3-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
887 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
888 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[I_ADDR]], align 4
889 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[N_ADDR]], align 4
890 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
891 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP1]], align 4
892 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
893 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
894 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
895 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
896 // CHECK3-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
897 // CHECK3-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
898 // CHECK3-NEXT: store i32 0, ptr [[I3]], align 4
899 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
900 // CHECK3-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
901 // CHECK3-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
902 // CHECK3: omp.precond.then:
903 // CHECK3-NEXT: [[ARRAYDECAY:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP2]], i32 0, i32 0
904 // CHECK3-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[ARRAYDECAY]], i32 16) ]
905 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
906 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
907 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
908 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
909 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
910 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
911 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
912 // 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)
913 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
914 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
915 // CHECK3-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
916 // CHECK3-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
917 // CHECK3: cond.true:
918 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
919 // CHECK3-NEXT: br label [[COND_END:%.*]]
920 // CHECK3: cond.false:
921 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
922 // CHECK3-NEXT: br label [[COND_END]]
923 // CHECK3: cond.end:
924 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
925 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
926 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
927 // CHECK3-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
928 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
929 // CHECK3: omp.inner.for.cond:
930 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
931 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP6]]
932 // CHECK3-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
933 // CHECK3-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
934 // CHECK3: omp.inner.for.body:
935 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
936 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
937 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
938 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP6]]
939 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP6]]
940 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP2]], i32 0, i32 [[TMP17]]
941 // CHECK3-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP6]]
942 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
943 // CHECK3: omp.body.continue:
944 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
945 // CHECK3: omp.inner.for.inc:
946 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
947 // CHECK3-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP18]], 1
948 // CHECK3-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
949 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
950 // CHECK3: omp.inner.for.end:
951 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
952 // CHECK3: omp.loop.exit:
953 // CHECK3-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
954 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
955 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
956 // CHECK3-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
957 // CHECK3-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
958 // CHECK3-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
959 // CHECK3: .omp.final.then:
960 // CHECK3-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
961 // CHECK3-NEXT: [[SUB8:%.*]] = sub nsw i32 [[TMP23]], 0
962 // CHECK3-NEXT: [[DIV9:%.*]] = sdiv i32 [[SUB8]], 1
963 // CHECK3-NEXT: [[MUL10:%.*]] = mul nsw i32 [[DIV9]], 1
964 // CHECK3-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
965 // CHECK3-NEXT: store i32 [[ADD11]], ptr [[TMP0]], align 4
966 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
967 // CHECK3: .omp.final.done:
968 // CHECK3-NEXT: br label [[OMP_PRECOND_END]]
969 // CHECK3: omp.precond.end:
970 // CHECK3-NEXT: ret void
973 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36
974 // CHECK3-SAME: (i32 noundef [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
975 // CHECK3-NEXT: entry:
976 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
977 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
978 // CHECK3-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
979 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
980 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
981 // 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]])
982 // CHECK3-NEXT: ret void
985 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l36.omp_outlined
986 // 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]] {
987 // CHECK3-NEXT: entry:
988 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
989 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
990 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
991 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
992 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
993 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
994 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
995 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
996 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
997 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
998 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
999 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1000 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1001 // CHECK3-NEXT: [[I3:%.*]] = alloca i32, align 4
1002 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1003 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1004 // CHECK3-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
1005 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1006 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
1007 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1008 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
1009 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
1010 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1011 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
1012 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1013 // CHECK3-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1014 // CHECK3-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1015 // CHECK3-NEXT: store i32 0, ptr [[I]], align 4
1016 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1017 // CHECK3-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
1018 // CHECK3-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1019 // CHECK3: omp.precond.then:
1020 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1021 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1022 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
1023 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1024 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1025 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1026 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP6]], align 4
1027 // 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)
1028 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1029 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1030 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP8]], [[TMP9]]
1031 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1032 // CHECK3: cond.true:
1033 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1034 // CHECK3-NEXT: br label [[COND_END:%.*]]
1035 // CHECK3: cond.false:
1036 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1037 // CHECK3-NEXT: br label [[COND_END]]
1038 // CHECK3: cond.end:
1039 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ [[TMP10]], [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
1040 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1041 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1042 // CHECK3-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
1043 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1044 // CHECK3: omp.inner.for.cond:
1045 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1046 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1047 // CHECK3-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
1048 // CHECK3-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1049 // CHECK3: omp.inner.for.body:
1050 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1051 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP15]], 1
1052 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1053 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
1054 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[I3]], align 4
1055 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP1]], i32 0, i32 [[TMP16]]
1056 // CHECK3-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1057 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1058 // CHECK3: omp.body.continue:
1059 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1060 // CHECK3: omp.inner.for.inc:
1061 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1062 // CHECK3-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP17]], 1
1063 // CHECK3-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
1064 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP13:![0-9]+]]
1065 // CHECK3: omp.inner.for.end:
1066 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1067 // CHECK3: omp.loop.exit:
1068 // CHECK3-NEXT: [[TMP18:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1069 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP18]], align 4
1070 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP19]])
1071 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1072 // CHECK3-NEXT: [[TMP21:%.*]] = icmp ne i32 [[TMP20]], 0
1073 // CHECK3-NEXT: br i1 [[TMP21]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1074 // CHECK3: .omp.final.then:
1075 // CHECK3-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1076 // CHECK3-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP22]], 0
1077 // CHECK3-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
1078 // CHECK3-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
1079 // CHECK3-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
1080 // CHECK3-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
1081 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
1082 // CHECK3: .omp.final.done:
1083 // CHECK3-NEXT: br label [[OMP_PRECOND_END]]
1084 // CHECK3: omp.precond.end:
1085 // CHECK3-NEXT: ret void
1088 // CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1089 // CHECK3-SAME: () #[[ATTR4:[0-9]+]] {
1090 // CHECK3-NEXT: entry:
1091 // CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
1092 // CHECK3-NEXT: ret void
1095 // CHECK5-LABEL: define {{[^@]+}}@_Z21teams_argument_globali
1096 // CHECK5-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
1097 // CHECK5-NEXT: entry:
1098 // CHECK5-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
1099 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
1100 // CHECK5-NEXT: [[TE:%.*]] = alloca i32, align 4
1101 // CHECK5-NEXT: [[TH:%.*]] = alloca i32, align 4
1102 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
1103 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1104 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1105 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1106 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1107 // CHECK5-NEXT: [[I4:%.*]] = alloca i32, align 4
1108 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1109 // CHECK5-NEXT: [[DOTLINEAR_START:%.*]] = alloca i32, align 4
1110 // CHECK5-NEXT: [[I5:%.*]] = alloca i32, align 4
1111 // CHECK5-NEXT: [[I6:%.*]] = alloca i32, align 4
1112 // CHECK5-NEXT: [[_TMP13:%.*]] = alloca i32, align 4
1113 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_14:%.*]] = alloca i32, align 4
1114 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_15:%.*]] = alloca i32, align 4
1115 // CHECK5-NEXT: [[DOTOMP_LB19:%.*]] = alloca i32, align 4
1116 // CHECK5-NEXT: [[DOTOMP_UB20:%.*]] = alloca i32, align 4
1117 // CHECK5-NEXT: [[I21:%.*]] = alloca i32, align 4
1118 // CHECK5-NEXT: [[DOTOMP_IV24:%.*]] = alloca i32, align 4
1119 // CHECK5-NEXT: [[I25:%.*]] = alloca i32, align 4
1120 // CHECK5-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
1121 // CHECK5-NEXT: [[TMP0:%.*]] = load i32, ptr [[N_ADDR]], align 4
1122 // CHECK5-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP0]], 128
1123 // CHECK5-NEXT: store i32 [[DIV]], ptr [[TE]], align 4
1124 // CHECK5-NEXT: store i32 128, ptr [[TH]], align 4
1125 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[N_ADDR]], align 4
1126 // CHECK5-NEXT: store i32 [[TMP1]], ptr [[DOTCAPTURE_EXPR_]], align 4
1127 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1128 // CHECK5-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP2]], 0
1129 // CHECK5-NEXT: [[DIV2:%.*]] = sdiv i32 [[SUB]], 1
1130 // CHECK5-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV2]], 1
1131 // CHECK5-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1132 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1133 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1134 // CHECK5-NEXT: store i32 [[TMP3]], ptr [[DOTOMP_UB]], align 4
1135 // CHECK5-NEXT: store i32 0, ptr [[I4]], align 4
1136 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1137 // CHECK5-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
1138 // CHECK5-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
1139 // CHECK5: simd.if.then:
1140 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1141 // CHECK5-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
1142 // CHECK5-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr @a, i64 16) ]
1143 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[I]], align 4
1144 // CHECK5-NEXT: store i32 [[TMP6]], ptr [[DOTLINEAR_START]], align 4
1145 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1146 // CHECK5: omp.inner.for.cond:
1147 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
1148 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
1149 // CHECK5-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1150 // CHECK5-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1151 // CHECK5: omp.inner.for.body:
1152 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1153 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1154 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1155 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I5]], align 4, !llvm.access.group [[ACC_GRP2]]
1156 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[I5]], align 4, !llvm.access.group [[ACC_GRP2]]
1157 // CHECK5-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP10]] to i64
1158 // CHECK5-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr @a, i64 0, i64 [[IDXPROM]]
1159 // CHECK5-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
1160 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1161 // CHECK5: omp.body.continue:
1162 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1163 // CHECK5: omp.inner.for.inc:
1164 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1165 // CHECK5-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP11]], 1
1166 // CHECK5-NEXT: store i32 [[ADD8]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1167 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
1168 // CHECK5: omp.inner.for.end:
1169 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1170 // CHECK5-NEXT: [[SUB9:%.*]] = sub nsw i32 [[TMP12]], 0
1171 // CHECK5-NEXT: [[DIV10:%.*]] = sdiv i32 [[SUB9]], 1
1172 // CHECK5-NEXT: [[MUL11:%.*]] = mul nsw i32 [[DIV10]], 1
1173 // CHECK5-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
1174 // CHECK5-NEXT: store i32 [[ADD12]], ptr [[I]], align 4
1175 // CHECK5-NEXT: br label [[SIMD_IF_END]]
1176 // CHECK5: simd.if.end:
1177 // CHECK5-NEXT: [[TMP13:%.*]] = load i32, ptr [[N_ADDR]], align 4
1178 // CHECK5-NEXT: store i32 [[TMP13]], ptr [[DOTCAPTURE_EXPR_14]], align 4
1179 // CHECK5-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1180 // CHECK5-NEXT: [[SUB16:%.*]] = sub nsw i32 [[TMP14]], 0
1181 // CHECK5-NEXT: [[DIV17:%.*]] = sdiv i32 [[SUB16]], 1
1182 // CHECK5-NEXT: [[SUB18:%.*]] = sub nsw i32 [[DIV17]], 1
1183 // CHECK5-NEXT: store i32 [[SUB18]], ptr [[DOTCAPTURE_EXPR_15]], align 4
1184 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB19]], align 4
1185 // CHECK5-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_15]], align 4
1186 // CHECK5-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_UB20]], align 4
1187 // CHECK5-NEXT: store i32 0, ptr [[I21]], align 4
1188 // CHECK5-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1189 // CHECK5-NEXT: [[CMP22:%.*]] = icmp slt i32 0, [[TMP16]]
1190 // CHECK5-NEXT: br i1 [[CMP22]], label [[SIMD_IF_THEN23:%.*]], label [[SIMD_IF_END41:%.*]]
1191 // CHECK5: simd.if.then23:
1192 // CHECK5-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_LB19]], align 4
1193 // CHECK5-NEXT: store i32 [[TMP17]], ptr [[DOTOMP_IV24]], align 4
1194 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND26:%.*]]
1195 // CHECK5: omp.inner.for.cond26:
1196 // CHECK5-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1197 // CHECK5-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_UB20]], align 4
1198 // CHECK5-NEXT: [[CMP27:%.*]] = icmp sle i32 [[TMP18]], [[TMP19]]
1199 // CHECK5-NEXT: br i1 [[CMP27]], label [[OMP_INNER_FOR_BODY28:%.*]], label [[OMP_INNER_FOR_END36:%.*]]
1200 // CHECK5: omp.inner.for.body28:
1201 // CHECK5-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1202 // CHECK5-NEXT: [[MUL29:%.*]] = mul nsw i32 [[TMP20]], 1
1203 // CHECK5-NEXT: [[ADD30:%.*]] = add nsw i32 0, [[MUL29]]
1204 // CHECK5-NEXT: store i32 [[ADD30]], ptr [[I25]], align 4
1205 // CHECK5-NEXT: [[TMP21:%.*]] = load i32, ptr [[I25]], align 4
1206 // CHECK5-NEXT: [[IDXPROM31:%.*]] = sext i32 [[TMP21]] to i64
1207 // CHECK5-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [100 x i32], ptr @a, i64 0, i64 [[IDXPROM31]]
1208 // CHECK5-NEXT: store i32 0, ptr [[ARRAYIDX32]], align 4
1209 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE33:%.*]]
1210 // CHECK5: omp.body.continue33:
1211 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC34:%.*]]
1212 // CHECK5: omp.inner.for.inc34:
1213 // CHECK5-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1214 // CHECK5-NEXT: [[ADD35:%.*]] = add nsw i32 [[TMP22]], 1
1215 // CHECK5-NEXT: store i32 [[ADD35]], ptr [[DOTOMP_IV24]], align 4
1216 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND26]], !llvm.loop [[LOOP7:![0-9]+]]
1217 // CHECK5: omp.inner.for.end36:
1218 // CHECK5-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1219 // CHECK5-NEXT: [[SUB37:%.*]] = sub nsw i32 [[TMP23]], 0
1220 // CHECK5-NEXT: [[DIV38:%.*]] = sdiv i32 [[SUB37]], 1
1221 // CHECK5-NEXT: [[MUL39:%.*]] = mul nsw i32 [[DIV38]], 1
1222 // CHECK5-NEXT: [[ADD40:%.*]] = add nsw i32 0, [[MUL39]]
1223 // CHECK5-NEXT: store i32 [[ADD40]], ptr [[I25]], align 4
1224 // CHECK5-NEXT: br label [[SIMD_IF_END41]]
1225 // CHECK5: simd.if.end41:
1226 // CHECK5-NEXT: [[TMP24:%.*]] = load i32, ptr @a, align 4
1227 // CHECK5-NEXT: ret i32 [[TMP24]]
1230 // CHECK7-LABEL: define {{[^@]+}}@_Z21teams_argument_globali
1231 // CHECK7-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0:[0-9]+]] {
1232 // CHECK7-NEXT: entry:
1233 // CHECK7-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
1234 // CHECK7-NEXT: [[I:%.*]] = alloca i32, align 4
1235 // CHECK7-NEXT: [[TE:%.*]] = alloca i32, align 4
1236 // CHECK7-NEXT: [[TH:%.*]] = alloca i32, align 4
1237 // CHECK7-NEXT: [[TMP:%.*]] = alloca i32, align 4
1238 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1239 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1240 // CHECK7-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1241 // CHECK7-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1242 // CHECK7-NEXT: [[I4:%.*]] = alloca i32, align 4
1243 // CHECK7-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1244 // CHECK7-NEXT: [[DOTLINEAR_START:%.*]] = alloca i32, align 4
1245 // CHECK7-NEXT: [[I5:%.*]] = alloca i32, align 4
1246 // CHECK7-NEXT: [[I6:%.*]] = alloca i32, align 4
1247 // CHECK7-NEXT: [[_TMP13:%.*]] = alloca i32, align 4
1248 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_14:%.*]] = alloca i32, align 4
1249 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_15:%.*]] = alloca i32, align 4
1250 // CHECK7-NEXT: [[DOTOMP_LB19:%.*]] = alloca i32, align 4
1251 // CHECK7-NEXT: [[DOTOMP_UB20:%.*]] = alloca i32, align 4
1252 // CHECK7-NEXT: [[I21:%.*]] = alloca i32, align 4
1253 // CHECK7-NEXT: [[DOTOMP_IV24:%.*]] = alloca i32, align 4
1254 // CHECK7-NEXT: [[I25:%.*]] = alloca i32, align 4
1255 // CHECK7-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
1256 // CHECK7-NEXT: [[TMP0:%.*]] = load i32, ptr [[N_ADDR]], align 4
1257 // CHECK7-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP0]], 128
1258 // CHECK7-NEXT: store i32 [[DIV]], ptr [[TE]], align 4
1259 // CHECK7-NEXT: store i32 128, ptr [[TH]], align 4
1260 // CHECK7-NEXT: [[TMP1:%.*]] = load i32, ptr [[N_ADDR]], align 4
1261 // CHECK7-NEXT: store i32 [[TMP1]], ptr [[DOTCAPTURE_EXPR_]], align 4
1262 // CHECK7-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1263 // CHECK7-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP2]], 0
1264 // CHECK7-NEXT: [[DIV2:%.*]] = sdiv i32 [[SUB]], 1
1265 // CHECK7-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV2]], 1
1266 // CHECK7-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1267 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1268 // CHECK7-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1269 // CHECK7-NEXT: store i32 [[TMP3]], ptr [[DOTOMP_UB]], align 4
1270 // CHECK7-NEXT: store i32 0, ptr [[I4]], align 4
1271 // CHECK7-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1272 // CHECK7-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
1273 // CHECK7-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
1274 // CHECK7: simd.if.then:
1275 // CHECK7-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1276 // CHECK7-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
1277 // CHECK7-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr @a, i32 16) ]
1278 // CHECK7-NEXT: [[TMP6:%.*]] = load i32, ptr [[I]], align 4
1279 // CHECK7-NEXT: store i32 [[TMP6]], ptr [[DOTLINEAR_START]], align 4
1280 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1281 // CHECK7: omp.inner.for.cond:
1282 // CHECK7-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
1283 // CHECK7-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
1284 // CHECK7-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1285 // CHECK7-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1286 // CHECK7: omp.inner.for.body:
1287 // CHECK7-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1288 // CHECK7-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1289 // CHECK7-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1290 // CHECK7-NEXT: store i32 [[ADD]], ptr [[I5]], align 4, !llvm.access.group [[ACC_GRP3]]
1291 // CHECK7-NEXT: [[TMP10:%.*]] = load i32, ptr [[I5]], align 4, !llvm.access.group [[ACC_GRP3]]
1292 // CHECK7-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr @a, i32 0, i32 [[TMP10]]
1293 // CHECK7-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
1294 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1295 // CHECK7: omp.body.continue:
1296 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1297 // CHECK7: omp.inner.for.inc:
1298 // CHECK7-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1299 // CHECK7-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP11]], 1
1300 // CHECK7-NEXT: store i32 [[ADD8]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1301 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
1302 // CHECK7: omp.inner.for.end:
1303 // CHECK7-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1304 // CHECK7-NEXT: [[SUB9:%.*]] = sub nsw i32 [[TMP12]], 0
1305 // CHECK7-NEXT: [[DIV10:%.*]] = sdiv i32 [[SUB9]], 1
1306 // CHECK7-NEXT: [[MUL11:%.*]] = mul nsw i32 [[DIV10]], 1
1307 // CHECK7-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
1308 // CHECK7-NEXT: store i32 [[ADD12]], ptr [[I]], align 4
1309 // CHECK7-NEXT: br label [[SIMD_IF_END]]
1310 // CHECK7: simd.if.end:
1311 // CHECK7-NEXT: [[TMP13:%.*]] = load i32, ptr [[N_ADDR]], align 4
1312 // CHECK7-NEXT: store i32 [[TMP13]], ptr [[DOTCAPTURE_EXPR_14]], align 4
1313 // CHECK7-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1314 // CHECK7-NEXT: [[SUB16:%.*]] = sub nsw i32 [[TMP14]], 0
1315 // CHECK7-NEXT: [[DIV17:%.*]] = sdiv i32 [[SUB16]], 1
1316 // CHECK7-NEXT: [[SUB18:%.*]] = sub nsw i32 [[DIV17]], 1
1317 // CHECK7-NEXT: store i32 [[SUB18]], ptr [[DOTCAPTURE_EXPR_15]], align 4
1318 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB19]], align 4
1319 // CHECK7-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_15]], align 4
1320 // CHECK7-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_UB20]], align 4
1321 // CHECK7-NEXT: store i32 0, ptr [[I21]], align 4
1322 // CHECK7-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1323 // CHECK7-NEXT: [[CMP22:%.*]] = icmp slt i32 0, [[TMP16]]
1324 // CHECK7-NEXT: br i1 [[CMP22]], label [[SIMD_IF_THEN23:%.*]], label [[SIMD_IF_END40:%.*]]
1325 // CHECK7: simd.if.then23:
1326 // CHECK7-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_LB19]], align 4
1327 // CHECK7-NEXT: store i32 [[TMP17]], ptr [[DOTOMP_IV24]], align 4
1328 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND26:%.*]]
1329 // CHECK7: omp.inner.for.cond26:
1330 // CHECK7-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1331 // CHECK7-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_UB20]], align 4
1332 // CHECK7-NEXT: [[CMP27:%.*]] = icmp sle i32 [[TMP18]], [[TMP19]]
1333 // CHECK7-NEXT: br i1 [[CMP27]], label [[OMP_INNER_FOR_BODY28:%.*]], label [[OMP_INNER_FOR_END35:%.*]]
1334 // CHECK7: omp.inner.for.body28:
1335 // CHECK7-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1336 // CHECK7-NEXT: [[MUL29:%.*]] = mul nsw i32 [[TMP20]], 1
1337 // CHECK7-NEXT: [[ADD30:%.*]] = add nsw i32 0, [[MUL29]]
1338 // CHECK7-NEXT: store i32 [[ADD30]], ptr [[I25]], align 4
1339 // CHECK7-NEXT: [[TMP21:%.*]] = load i32, ptr [[I25]], align 4
1340 // CHECK7-NEXT: [[ARRAYIDX31:%.*]] = getelementptr inbounds [100 x i32], ptr @a, i32 0, i32 [[TMP21]]
1341 // CHECK7-NEXT: store i32 0, ptr [[ARRAYIDX31]], align 4
1342 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE32:%.*]]
1343 // CHECK7: omp.body.continue32:
1344 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC33:%.*]]
1345 // CHECK7: omp.inner.for.inc33:
1346 // CHECK7-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV24]], align 4
1347 // CHECK7-NEXT: [[ADD34:%.*]] = add nsw i32 [[TMP22]], 1
1348 // CHECK7-NEXT: store i32 [[ADD34]], ptr [[DOTOMP_IV24]], align 4
1349 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND26]], !llvm.loop [[LOOP8:![0-9]+]]
1350 // CHECK7: omp.inner.for.end35:
1351 // CHECK7-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_14]], align 4
1352 // CHECK7-NEXT: [[SUB36:%.*]] = sub nsw i32 [[TMP23]], 0
1353 // CHECK7-NEXT: [[DIV37:%.*]] = sdiv i32 [[SUB36]], 1
1354 // CHECK7-NEXT: [[MUL38:%.*]] = mul nsw i32 [[DIV37]], 1
1355 // CHECK7-NEXT: [[ADD39:%.*]] = add nsw i32 0, [[MUL38]]
1356 // CHECK7-NEXT: store i32 [[ADD39]], ptr [[I25]], align 4
1357 // CHECK7-NEXT: br label [[SIMD_IF_END40]]
1358 // CHECK7: simd.if.end40:
1359 // CHECK7-NEXT: [[TMP24:%.*]] = load i32, ptr @a, align 4
1360 // CHECK7-NEXT: ret i32 [[TMP24]]
1363 // CHECK9-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1364 // CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
1365 // CHECK9-NEXT: entry:
1366 // CHECK9-NEXT: [[N:%.*]] = alloca i32, align 4
1367 // CHECK9-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
1368 // CHECK9-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
1369 // CHECK9-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
1370 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
1371 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
1372 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
1373 // CHECK9-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
1374 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1375 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1376 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1377 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1378 // CHECK9-NEXT: store i32 100, ptr [[N]], align 4
1379 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1380 // CHECK9-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
1381 // CHECK9-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
1382 // CHECK9-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
1383 // CHECK9-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
1384 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
1385 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
1386 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[N_CASTED]], align 4
1387 // CHECK9-NEXT: [[TMP4:%.*]] = load i64, ptr [[N_CASTED]], align 8
1388 // CHECK9-NEXT: [[TMP5:%.*]] = mul nuw i64 [[TMP1]], 4
1389 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
1390 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1391 // CHECK9-NEXT: store i64 [[TMP4]], ptr [[TMP6]], align 8
1392 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1393 // CHECK9-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
1394 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
1395 // CHECK9-NEXT: store ptr null, ptr [[TMP8]], align 8
1396 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1397 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP9]], align 8
1398 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1399 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP10]], align 8
1400 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
1401 // CHECK9-NEXT: store ptr null, ptr [[TMP11]], align 8
1402 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1403 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 8
1404 // CHECK9-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1405 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 8
1406 // CHECK9-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
1407 // CHECK9-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 8
1408 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
1409 // CHECK9-NEXT: store ptr null, ptr [[TMP15]], align 8
1410 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1411 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1412 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
1413 // CHECK9-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
1414 // CHECK9-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
1415 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1416 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
1417 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1418 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1419 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1420 // CHECK9-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1421 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
1422 // CHECK9-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
1423 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1424 // CHECK9-NEXT: store i32 2, ptr [[TMP23]], align 4
1425 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1426 // CHECK9-NEXT: store i32 3, ptr [[TMP24]], align 4
1427 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1428 // CHECK9-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 8
1429 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1430 // CHECK9-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 8
1431 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1432 // CHECK9-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 8
1433 // CHECK9-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1434 // CHECK9-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 8
1435 // CHECK9-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1436 // CHECK9-NEXT: store ptr null, ptr [[TMP29]], align 8
1437 // CHECK9-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1438 // CHECK9-NEXT: store ptr null, ptr [[TMP30]], align 8
1439 // CHECK9-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1440 // CHECK9-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
1441 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1442 // CHECK9-NEXT: store i64 0, ptr [[TMP32]], align 8
1443 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1444 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
1445 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1446 // CHECK9-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP34]], align 4
1447 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1448 // CHECK9-NEXT: store i32 0, ptr [[TMP35]], align 4
1449 // 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]])
1450 // CHECK9-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
1451 // CHECK9-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1452 // CHECK9: omp_offload.failed:
1453 // 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]+]]
1454 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
1455 // CHECK9: omp_offload.cont:
1456 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 0
1457 // CHECK9-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
1458 // CHECK9-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
1459 // CHECK9-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
1460 // CHECK9-NEXT: ret i32 [[TMP38]]
1463 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75
1464 // CHECK9-SAME: (i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
1465 // CHECK9-NEXT: entry:
1466 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
1467 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1468 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1469 // CHECK9-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
1470 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1471 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1472 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1473 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1474 // 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]])
1475 // CHECK9-NEXT: ret void
1478 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75.omp_outlined
1479 // 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]] {
1480 // CHECK9-NEXT: entry:
1481 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1482 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1483 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
1484 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1485 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1486 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1487 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1488 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1489 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1490 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1491 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1492 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1493 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1494 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1495 // CHECK9-NEXT: [[I3:%.*]] = alloca i32, align 4
1496 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1497 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1498 // CHECK9-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
1499 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1500 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1501 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
1502 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1503 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1504 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1505 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1506 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1507 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1508 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1509 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1510 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1511 // CHECK9-NEXT: store i32 0, ptr [[I]], align 4
1512 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1513 // CHECK9-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1514 // CHECK9-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1515 // CHECK9: omp.precond.then:
1516 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1517 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1518 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
1519 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1520 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1521 // CHECK9-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1522 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
1523 // 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)
1524 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1525 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1526 // CHECK9-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
1527 // CHECK9-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1528 // CHECK9: cond.true:
1529 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1530 // CHECK9-NEXT: br label [[COND_END:%.*]]
1531 // CHECK9: cond.false:
1532 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1533 // CHECK9-NEXT: br label [[COND_END]]
1534 // CHECK9: cond.end:
1535 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1536 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1537 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1538 // CHECK9-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
1539 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1540 // CHECK9: omp.inner.for.cond:
1541 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4:![0-9]+]]
1542 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP4]]
1543 // CHECK9-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
1544 // CHECK9-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1545 // CHECK9: omp.inner.for.body:
1546 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
1547 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
1548 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1549 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP4]]
1550 // CHECK9-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP4]]
1551 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
1552 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
1553 // CHECK9-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP4]]
1554 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1555 // CHECK9: omp.body.continue:
1556 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1557 // CHECK9: omp.inner.for.inc:
1558 // CHECK9-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
1559 // CHECK9-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
1560 // CHECK9-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
1561 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP5:![0-9]+]]
1562 // CHECK9: omp.inner.for.end:
1563 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1564 // CHECK9: omp.loop.exit:
1565 // CHECK9-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1566 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
1567 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
1568 // CHECK9-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1569 // CHECK9-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
1570 // CHECK9-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1571 // CHECK9: .omp.final.then:
1572 // CHECK9-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1573 // CHECK9-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP23]], 0
1574 // CHECK9-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
1575 // CHECK9-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
1576 // CHECK9-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
1577 // CHECK9-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
1578 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
1579 // CHECK9: .omp.final.done:
1580 // CHECK9-NEXT: br label [[OMP_PRECOND_END]]
1581 // CHECK9: omp.precond.end:
1582 // CHECK9-NEXT: ret void
1585 // CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1586 // CHECK9-SAME: () #[[ATTR5:[0-9]+]] {
1587 // CHECK9-NEXT: entry:
1588 // CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
1589 // CHECK9-NEXT: ret void
1592 // CHECK11-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1593 // CHECK11-SAME: () #[[ATTR0:[0-9]+]] {
1594 // CHECK11-NEXT: entry:
1595 // CHECK11-NEXT: [[N:%.*]] = alloca i32, align 4
1596 // CHECK11-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
1597 // CHECK11-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
1598 // CHECK11-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
1599 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
1600 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
1601 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
1602 // CHECK11-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
1603 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1604 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1605 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1606 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1607 // CHECK11-NEXT: store i32 100, ptr [[N]], align 4
1608 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1609 // CHECK11-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
1610 // CHECK11-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
1611 // CHECK11-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
1612 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
1613 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
1614 // CHECK11-NEXT: store i32 [[TMP2]], ptr [[N_CASTED]], align 4
1615 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[N_CASTED]], align 4
1616 // CHECK11-NEXT: [[TMP4:%.*]] = mul nuw i32 [[TMP0]], 4
1617 // CHECK11-NEXT: [[TMP5:%.*]] = sext i32 [[TMP4]] to i64
1618 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
1619 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1620 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[TMP6]], align 4
1621 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1622 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
1623 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
1624 // CHECK11-NEXT: store ptr null, ptr [[TMP8]], align 4
1625 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1626 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP9]], align 4
1627 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1628 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP10]], align 4
1629 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
1630 // CHECK11-NEXT: store ptr null, ptr [[TMP11]], align 4
1631 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1632 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 4
1633 // CHECK11-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1634 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 4
1635 // CHECK11-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
1636 // CHECK11-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 4
1637 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
1638 // CHECK11-NEXT: store ptr null, ptr [[TMP15]], align 4
1639 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1640 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1641 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
1642 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
1643 // CHECK11-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
1644 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1645 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
1646 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1647 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1648 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1649 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1650 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
1651 // CHECK11-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
1652 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1653 // CHECK11-NEXT: store i32 2, ptr [[TMP23]], align 4
1654 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1655 // CHECK11-NEXT: store i32 3, ptr [[TMP24]], align 4
1656 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1657 // CHECK11-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 4
1658 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1659 // CHECK11-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 4
1660 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1661 // CHECK11-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 4
1662 // CHECK11-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1663 // CHECK11-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 4
1664 // CHECK11-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1665 // CHECK11-NEXT: store ptr null, ptr [[TMP29]], align 4
1666 // CHECK11-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1667 // CHECK11-NEXT: store ptr null, ptr [[TMP30]], align 4
1668 // CHECK11-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1669 // CHECK11-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
1670 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1671 // CHECK11-NEXT: store i64 0, ptr [[TMP32]], align 8
1672 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1673 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
1674 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1675 // CHECK11-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP34]], align 4
1676 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1677 // CHECK11-NEXT: store i32 0, ptr [[TMP35]], align 4
1678 // 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]])
1679 // CHECK11-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
1680 // CHECK11-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1681 // CHECK11: omp_offload.failed:
1682 // 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]+]]
1683 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
1684 // CHECK11: omp_offload.cont:
1685 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 0
1686 // CHECK11-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
1687 // CHECK11-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
1688 // CHECK11-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
1689 // CHECK11-NEXT: ret i32 [[TMP38]]
1692 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75
1693 // CHECK11-SAME: (i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
1694 // CHECK11-NEXT: entry:
1695 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
1696 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
1697 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1698 // CHECK11-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
1699 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
1700 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1701 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
1702 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1703 // 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]])
1704 // CHECK11-NEXT: ret void
1707 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l75.omp_outlined
1708 // 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]] {
1709 // CHECK11-NEXT: entry:
1710 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1711 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1712 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
1713 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
1714 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1715 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1716 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1717 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1718 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1719 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1720 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1721 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1722 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1723 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1724 // CHECK11-NEXT: [[I3:%.*]] = alloca i32, align 4
1725 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1726 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1727 // CHECK11-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
1728 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
1729 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1730 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
1731 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
1732 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1733 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1734 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1735 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1736 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1737 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1738 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1739 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1740 // CHECK11-NEXT: store i32 0, ptr [[I]], align 4
1741 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1742 // CHECK11-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1743 // CHECK11-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1744 // CHECK11: omp.precond.then:
1745 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1746 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1747 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
1748 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1749 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1750 // CHECK11-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1751 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
1752 // 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)
1753 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1754 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1755 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
1756 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1757 // CHECK11: cond.true:
1758 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1759 // CHECK11-NEXT: br label [[COND_END:%.*]]
1760 // CHECK11: cond.false:
1761 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1762 // CHECK11-NEXT: br label [[COND_END]]
1763 // CHECK11: cond.end:
1764 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1765 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1766 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1767 // CHECK11-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
1768 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1769 // CHECK11: omp.inner.for.cond:
1770 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
1771 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
1772 // CHECK11-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
1773 // CHECK11-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1774 // CHECK11: omp.inner.for.body:
1775 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
1776 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
1777 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1778 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP5]]
1779 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP5]]
1780 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP17]]
1781 // CHECK11-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
1782 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1783 // CHECK11: omp.body.continue:
1784 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1785 // CHECK11: omp.inner.for.inc:
1786 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
1787 // CHECK11-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
1788 // CHECK11-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
1789 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
1790 // CHECK11: omp.inner.for.end:
1791 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1792 // CHECK11: omp.loop.exit:
1793 // CHECK11-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1794 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
1795 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
1796 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1797 // CHECK11-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
1798 // CHECK11-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1799 // CHECK11: .omp.final.then:
1800 // CHECK11-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1801 // CHECK11-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP23]], 0
1802 // CHECK11-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
1803 // CHECK11-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
1804 // CHECK11-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
1805 // CHECK11-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
1806 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
1807 // CHECK11: .omp.final.done:
1808 // CHECK11-NEXT: br label [[OMP_PRECOND_END]]
1809 // CHECK11: omp.precond.end:
1810 // CHECK11-NEXT: ret void
1813 // CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1814 // CHECK11-SAME: () #[[ATTR5:[0-9]+]] {
1815 // CHECK11-NEXT: entry:
1816 // CHECK11-NEXT: call void @__tgt_register_requires(i64 1)
1817 // CHECK11-NEXT: ret void
1820 // CHECK13-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1821 // CHECK13-SAME: () #[[ATTR0:[0-9]+]] {
1822 // CHECK13-NEXT: entry:
1823 // CHECK13-NEXT: [[N:%.*]] = alloca i32, align 4
1824 // CHECK13-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
1825 // CHECK13-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
1826 // CHECK13-NEXT: [[TMP:%.*]] = alloca i32, align 4
1827 // CHECK13-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1828 // CHECK13-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1829 // CHECK13-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1830 // CHECK13-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1831 // CHECK13-NEXT: [[I:%.*]] = alloca i32, align 4
1832 // CHECK13-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1833 // CHECK13-NEXT: [[I3:%.*]] = alloca i32, align 4
1834 // CHECK13-NEXT: store i32 100, ptr [[N]], align 4
1835 // CHECK13-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1836 // CHECK13-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
1837 // CHECK13-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
1838 // CHECK13-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
1839 // CHECK13-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
1840 // CHECK13-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
1841 // CHECK13-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
1842 // CHECK13-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1843 // CHECK13-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1844 // CHECK13-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1845 // CHECK13-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1846 // CHECK13-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1847 // CHECK13-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1848 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1849 // CHECK13-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1850 // CHECK13-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
1851 // CHECK13-NEXT: store i32 0, ptr [[I]], align 4
1852 // CHECK13-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1853 // CHECK13-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP6]]
1854 // CHECK13-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
1855 // CHECK13: simd.if.then:
1856 // CHECK13-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1857 // CHECK13-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
1858 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1859 // CHECK13: omp.inner.for.cond:
1860 // CHECK13-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
1861 // CHECK13-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
1862 // CHECK13-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
1863 // CHECK13-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1864 // CHECK13: omp.inner.for.body:
1865 // CHECK13-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1866 // CHECK13-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
1867 // CHECK13-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1868 // CHECK13-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP2]]
1869 // CHECK13-NEXT: [[TMP11:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP2]]
1870 // CHECK13-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
1871 // CHECK13-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 [[IDXPROM]]
1872 // CHECK13-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
1873 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1874 // CHECK13: omp.body.continue:
1875 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1876 // CHECK13: omp.inner.for.inc:
1877 // CHECK13-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1878 // CHECK13-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP12]], 1
1879 // CHECK13-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
1880 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
1881 // CHECK13: omp.inner.for.end:
1882 // CHECK13-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1883 // CHECK13-NEXT: [[SUB6:%.*]] = sub nsw i32 [[TMP13]], 0
1884 // CHECK13-NEXT: [[DIV7:%.*]] = sdiv i32 [[SUB6]], 1
1885 // CHECK13-NEXT: [[MUL8:%.*]] = mul nsw i32 [[DIV7]], 1
1886 // CHECK13-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
1887 // CHECK13-NEXT: store i32 [[ADD9]], ptr [[I3]], align 4
1888 // CHECK13-NEXT: br label [[SIMD_IF_END]]
1889 // CHECK13: simd.if.end:
1890 // CHECK13-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 0
1891 // CHECK13-NEXT: [[TMP14:%.*]] = load i32, ptr [[ARRAYIDX10]], align 4
1892 // CHECK13-NEXT: [[TMP15:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
1893 // CHECK13-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP15]])
1894 // CHECK13-NEXT: ret i32 [[TMP14]]
1897 // CHECK15-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1898 // CHECK15-SAME: () #[[ATTR0:[0-9]+]] {
1899 // CHECK15-NEXT: entry:
1900 // CHECK15-NEXT: [[N:%.*]] = alloca i32, align 4
1901 // CHECK15-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
1902 // CHECK15-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
1903 // CHECK15-NEXT: [[TMP:%.*]] = alloca i32, align 4
1904 // CHECK15-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1905 // CHECK15-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1906 // CHECK15-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1907 // CHECK15-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1908 // CHECK15-NEXT: [[I:%.*]] = alloca i32, align 4
1909 // CHECK15-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1910 // CHECK15-NEXT: [[I3:%.*]] = alloca i32, align 4
1911 // CHECK15-NEXT: store i32 100, ptr [[N]], align 4
1912 // CHECK15-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1913 // CHECK15-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
1914 // CHECK15-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
1915 // CHECK15-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
1916 // CHECK15-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
1917 // CHECK15-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
1918 // CHECK15-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
1919 // CHECK15-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1920 // CHECK15-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
1921 // CHECK15-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1922 // CHECK15-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1923 // CHECK15-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1924 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1925 // CHECK15-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1926 // CHECK15-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_UB]], align 4
1927 // CHECK15-NEXT: store i32 0, ptr [[I]], align 4
1928 // CHECK15-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1929 // CHECK15-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1930 // CHECK15-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
1931 // CHECK15: simd.if.then:
1932 // CHECK15-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1933 // CHECK15-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1934 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1935 // CHECK15: omp.inner.for.cond:
1936 // CHECK15-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
1937 // CHECK15-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
1938 // CHECK15-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1939 // CHECK15-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1940 // CHECK15: omp.inner.for.body:
1941 // CHECK15-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1942 // CHECK15-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1943 // CHECK15-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1944 // CHECK15-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP3]]
1945 // CHECK15-NEXT: [[TMP10:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP3]]
1946 // CHECK15-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 [[TMP10]]
1947 // CHECK15-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
1948 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1949 // CHECK15: omp.body.continue:
1950 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1951 // CHECK15: omp.inner.for.inc:
1952 // CHECK15-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1953 // CHECK15-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP11]], 1
1954 // CHECK15-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
1955 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
1956 // CHECK15: omp.inner.for.end:
1957 // CHECK15-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1958 // CHECK15-NEXT: [[SUB6:%.*]] = sub nsw i32 [[TMP12]], 0
1959 // CHECK15-NEXT: [[DIV7:%.*]] = sdiv i32 [[SUB6]], 1
1960 // CHECK15-NEXT: [[MUL8:%.*]] = mul nsw i32 [[DIV7]], 1
1961 // CHECK15-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
1962 // CHECK15-NEXT: store i32 [[ADD9]], ptr [[I3]], align 4
1963 // CHECK15-NEXT: br label [[SIMD_IF_END]]
1964 // CHECK15: simd.if.end:
1965 // CHECK15-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 0
1966 // CHECK15-NEXT: [[TMP13:%.*]] = load i32, ptr [[ARRAYIDX10]], align 4
1967 // CHECK15-NEXT: [[TMP14:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
1968 // CHECK15-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP14]])
1969 // CHECK15-NEXT: ret i32 [[TMP13]]
1972 // CHECK17-LABEL: define {{[^@]+}}@_Z21teams_template_structv
1973 // CHECK17-SAME: () #[[ATTR0:[0-9]+]] {
1974 // CHECK17-NEXT: entry:
1975 // CHECK17-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
1976 // CHECK17-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
1977 // CHECK17-NEXT: ret i32 [[CALL]]
1980 // CHECK17-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
1981 // CHECK17-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
1982 // CHECK17-NEXT: entry:
1983 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1984 // CHECK17-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
1985 // CHECK17-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
1986 // CHECK17-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
1987 // CHECK17-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
1988 // CHECK17-NEXT: [[TMP:%.*]] = alloca i32, align 4
1989 // CHECK17-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1990 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1991 // CHECK17-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1992 // CHECK17-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
1993 // CHECK17-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
1994 // CHECK17-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[B]], i32 1
1995 // CHECK17-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[TMP0]] to i64
1996 // CHECK17-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A]] to i64
1997 // CHECK17-NEXT: [[TMP3:%.*]] = sub i64 [[TMP1]], [[TMP2]]
1998 // CHECK17-NEXT: [[TMP4:%.*]] = sdiv exact i64 [[TMP3]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
1999 // CHECK17-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
2000 // CHECK17-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2001 // CHECK17-NEXT: store ptr [[THIS1]], ptr [[TMP5]], align 8
2002 // CHECK17-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2003 // CHECK17-NEXT: store ptr [[A]], ptr [[TMP6]], align 8
2004 // CHECK17-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2005 // CHECK17-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
2006 // CHECK17-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
2007 // CHECK17-NEXT: store ptr null, ptr [[TMP8]], align 8
2008 // CHECK17-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2009 // CHECK17-NEXT: store ptr [[THIS1]], ptr [[TMP9]], align 8
2010 // CHECK17-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2011 // CHECK17-NEXT: store ptr [[B]], ptr [[TMP10]], align 8
2012 // CHECK17-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
2013 // CHECK17-NEXT: store ptr null, ptr [[TMP11]], align 8
2014 // CHECK17-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2015 // CHECK17-NEXT: store ptr [[THIS1]], ptr [[TMP12]], align 8
2016 // CHECK17-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2017 // CHECK17-NEXT: store ptr [[A]], ptr [[TMP13]], align 8
2018 // CHECK17-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
2019 // CHECK17-NEXT: store ptr null, ptr [[TMP14]], align 8
2020 // CHECK17-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2021 // CHECK17-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2022 // CHECK17-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2023 // CHECK17-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2024 // CHECK17-NEXT: store i32 2, ptr [[TMP18]], align 4
2025 // CHECK17-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2026 // CHECK17-NEXT: store i32 3, ptr [[TMP19]], align 4
2027 // CHECK17-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2028 // CHECK17-NEXT: store ptr [[TMP15]], ptr [[TMP20]], align 8
2029 // CHECK17-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2030 // CHECK17-NEXT: store ptr [[TMP16]], ptr [[TMP21]], align 8
2031 // CHECK17-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2032 // CHECK17-NEXT: store ptr [[TMP17]], ptr [[TMP22]], align 8
2033 // CHECK17-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2034 // CHECK17-NEXT: store ptr @.offload_maptypes, ptr [[TMP23]], align 8
2035 // CHECK17-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2036 // CHECK17-NEXT: store ptr null, ptr [[TMP24]], align 8
2037 // CHECK17-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2038 // CHECK17-NEXT: store ptr null, ptr [[TMP25]], align 8
2039 // CHECK17-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2040 // CHECK17-NEXT: store i64 123, ptr [[TMP26]], align 8
2041 // CHECK17-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2042 // CHECK17-NEXT: store i64 0, ptr [[TMP27]], align 8
2043 // CHECK17-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2044 // CHECK17-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
2045 // CHECK17-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2046 // CHECK17-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP29]], align 4
2047 // CHECK17-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2048 // CHECK17-NEXT: store i32 0, ptr [[TMP30]], align 4
2049 // 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]])
2050 // CHECK17-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
2051 // CHECK17-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2052 // CHECK17: omp_offload.failed:
2053 // CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123(ptr [[THIS1]]) #[[ATTR2:[0-9]+]]
2054 // CHECK17-NEXT: br label [[OMP_OFFLOAD_CONT]]
2055 // CHECK17: omp_offload.cont:
2056 // CHECK17-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2057 // CHECK17-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i64 0, i64 0
2058 // CHECK17-NEXT: [[TMP33:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2059 // CHECK17-NEXT: ret i32 [[TMP33]]
2062 // CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123
2063 // CHECK17-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2064 // CHECK17-NEXT: entry:
2065 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2066 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2067 // CHECK17-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2068 // 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]])
2069 // CHECK17-NEXT: ret void
2072 // CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined
2073 // CHECK17-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR1]] {
2074 // CHECK17-NEXT: entry:
2075 // CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2076 // CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2077 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2078 // CHECK17-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2079 // CHECK17-NEXT: [[TMP:%.*]] = alloca i32, align 4
2080 // CHECK17-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2081 // CHECK17-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2082 // CHECK17-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2083 // CHECK17-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2084 // CHECK17-NEXT: [[I:%.*]] = alloca i32, align 4
2085 // CHECK17-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2086 // CHECK17-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2087 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2088 // CHECK17-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2089 // CHECK17-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2090 // CHECK17-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2091 // CHECK17-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2092 // CHECK17-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2093 // CHECK17-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2094 // CHECK17-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2095 // 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)
2096 // CHECK17-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2097 // CHECK17-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2098 // CHECK17-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2099 // CHECK17: cond.true:
2100 // CHECK17-NEXT: br label [[COND_END:%.*]]
2101 // CHECK17: cond.false:
2102 // CHECK17-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2103 // CHECK17-NEXT: br label [[COND_END]]
2104 // CHECK17: cond.end:
2105 // CHECK17-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2106 // CHECK17-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2107 // CHECK17-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2108 // CHECK17-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2109 // CHECK17-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2110 // CHECK17: omp.inner.for.cond:
2111 // CHECK17-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4:![0-9]+]]
2112 // CHECK17-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP4]]
2113 // CHECK17-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2114 // CHECK17-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2115 // CHECK17: omp.inner.for.body:
2116 // CHECK17-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2117 // CHECK17-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
2118 // CHECK17-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2119 // CHECK17-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP4]]
2120 // CHECK17-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2121 // CHECK17-NEXT: [[TMP9:%.*]] = load float, ptr [[B]], align 4, !llvm.access.group [[ACC_GRP4]]
2122 // CHECK17-NEXT: [[CONV:%.*]] = fptosi float [[TMP9]] to i32
2123 // CHECK17-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2124 // CHECK17-NEXT: [[TMP10:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP4]]
2125 // CHECK17-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP10]] to i64
2126 // CHECK17-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
2127 // CHECK17-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP4]]
2128 // CHECK17-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2129 // CHECK17: omp.body.continue:
2130 // CHECK17-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2131 // CHECK17: omp.inner.for.inc:
2132 // CHECK17-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2133 // CHECK17-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP11]], 1
2134 // CHECK17-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2135 // CHECK17-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP5:![0-9]+]]
2136 // CHECK17: omp.inner.for.end:
2137 // CHECK17-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2138 // CHECK17: omp.loop.exit:
2139 // CHECK17-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2140 // CHECK17-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2141 // CHECK17-NEXT: [[TMP13:%.*]] = icmp ne i32 [[TMP12]], 0
2142 // CHECK17-NEXT: br i1 [[TMP13]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2143 // CHECK17: .omp.final.then:
2144 // CHECK17-NEXT: store i32 123, ptr [[I]], align 4
2145 // CHECK17-NEXT: br label [[DOTOMP_FINAL_DONE]]
2146 // CHECK17: .omp.final.done:
2147 // CHECK17-NEXT: ret void
2150 // CHECK17-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
2151 // CHECK17-SAME: () #[[ATTR4:[0-9]+]] {
2152 // CHECK17-NEXT: entry:
2153 // CHECK17-NEXT: call void @__tgt_register_requires(i64 1)
2154 // CHECK17-NEXT: ret void
2157 // CHECK19-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2158 // CHECK19-SAME: () #[[ATTR0:[0-9]+]] {
2159 // CHECK19-NEXT: entry:
2160 // CHECK19-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2161 // CHECK19-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2162 // CHECK19-NEXT: ret i32 [[CALL]]
2165 // CHECK19-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2166 // CHECK19-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
2167 // CHECK19-NEXT: entry:
2168 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2169 // CHECK19-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
2170 // CHECK19-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
2171 // CHECK19-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
2172 // CHECK19-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
2173 // CHECK19-NEXT: [[TMP:%.*]] = alloca i32, align 4
2174 // CHECK19-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2175 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2176 // CHECK19-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2177 // CHECK19-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2178 // CHECK19-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2179 // CHECK19-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[B]], i32 1
2180 // CHECK19-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[TMP0]] to i64
2181 // CHECK19-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A]] to i64
2182 // CHECK19-NEXT: [[TMP3:%.*]] = sub i64 [[TMP1]], [[TMP2]]
2183 // CHECK19-NEXT: [[TMP4:%.*]] = sdiv exact i64 [[TMP3]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
2184 // CHECK19-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
2185 // CHECK19-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2186 // CHECK19-NEXT: store ptr [[THIS1]], ptr [[TMP5]], align 4
2187 // CHECK19-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2188 // CHECK19-NEXT: store ptr [[A]], ptr [[TMP6]], align 4
2189 // CHECK19-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2190 // CHECK19-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 4
2191 // CHECK19-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
2192 // CHECK19-NEXT: store ptr null, ptr [[TMP8]], align 4
2193 // CHECK19-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2194 // CHECK19-NEXT: store ptr [[THIS1]], ptr [[TMP9]], align 4
2195 // CHECK19-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2196 // CHECK19-NEXT: store ptr [[B]], ptr [[TMP10]], align 4
2197 // CHECK19-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
2198 // CHECK19-NEXT: store ptr null, ptr [[TMP11]], align 4
2199 // CHECK19-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2200 // CHECK19-NEXT: store ptr [[THIS1]], ptr [[TMP12]], align 4
2201 // CHECK19-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2202 // CHECK19-NEXT: store ptr [[A]], ptr [[TMP13]], align 4
2203 // CHECK19-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
2204 // CHECK19-NEXT: store ptr null, ptr [[TMP14]], align 4
2205 // CHECK19-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2206 // CHECK19-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2207 // CHECK19-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2208 // CHECK19-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2209 // CHECK19-NEXT: store i32 2, ptr [[TMP18]], align 4
2210 // CHECK19-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2211 // CHECK19-NEXT: store i32 3, ptr [[TMP19]], align 4
2212 // CHECK19-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2213 // CHECK19-NEXT: store ptr [[TMP15]], ptr [[TMP20]], align 4
2214 // CHECK19-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2215 // CHECK19-NEXT: store ptr [[TMP16]], ptr [[TMP21]], align 4
2216 // CHECK19-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2217 // CHECK19-NEXT: store ptr [[TMP17]], ptr [[TMP22]], align 4
2218 // CHECK19-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2219 // CHECK19-NEXT: store ptr @.offload_maptypes, ptr [[TMP23]], align 4
2220 // CHECK19-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2221 // CHECK19-NEXT: store ptr null, ptr [[TMP24]], align 4
2222 // CHECK19-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2223 // CHECK19-NEXT: store ptr null, ptr [[TMP25]], align 4
2224 // CHECK19-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2225 // CHECK19-NEXT: store i64 123, ptr [[TMP26]], align 8
2226 // CHECK19-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2227 // CHECK19-NEXT: store i64 0, ptr [[TMP27]], align 8
2228 // CHECK19-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2229 // CHECK19-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
2230 // CHECK19-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2231 // CHECK19-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP29]], align 4
2232 // CHECK19-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2233 // CHECK19-NEXT: store i32 0, ptr [[TMP30]], align 4
2234 // 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]])
2235 // CHECK19-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
2236 // CHECK19-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2237 // CHECK19: omp_offload.failed:
2238 // CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123(ptr [[THIS1]]) #[[ATTR2:[0-9]+]]
2239 // CHECK19-NEXT: br label [[OMP_OFFLOAD_CONT]]
2240 // CHECK19: omp_offload.cont:
2241 // CHECK19-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2242 // CHECK19-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i32 0, i32 0
2243 // CHECK19-NEXT: [[TMP33:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2244 // CHECK19-NEXT: ret i32 [[TMP33]]
2247 // CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123
2248 // CHECK19-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2249 // CHECK19-NEXT: entry:
2250 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2251 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2252 // CHECK19-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2253 // 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]])
2254 // CHECK19-NEXT: ret void
2257 // CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined
2258 // CHECK19-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR1]] {
2259 // CHECK19-NEXT: entry:
2260 // CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2261 // CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2262 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2263 // CHECK19-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2264 // CHECK19-NEXT: [[TMP:%.*]] = alloca i32, align 4
2265 // CHECK19-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2266 // CHECK19-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2267 // CHECK19-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2268 // CHECK19-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2269 // CHECK19-NEXT: [[I:%.*]] = alloca i32, align 4
2270 // CHECK19-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2271 // CHECK19-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2272 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2273 // CHECK19-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2274 // CHECK19-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2275 // CHECK19-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2276 // CHECK19-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2277 // CHECK19-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2278 // CHECK19-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2279 // CHECK19-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2280 // 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)
2281 // CHECK19-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2282 // CHECK19-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2283 // CHECK19-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2284 // CHECK19: cond.true:
2285 // CHECK19-NEXT: br label [[COND_END:%.*]]
2286 // CHECK19: cond.false:
2287 // CHECK19-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2288 // CHECK19-NEXT: br label [[COND_END]]
2289 // CHECK19: cond.end:
2290 // CHECK19-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2291 // CHECK19-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2292 // CHECK19-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2293 // CHECK19-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2294 // CHECK19-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2295 // CHECK19: omp.inner.for.cond:
2296 // CHECK19-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
2297 // CHECK19-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
2298 // CHECK19-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2299 // CHECK19-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2300 // CHECK19: omp.inner.for.body:
2301 // CHECK19-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2302 // CHECK19-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
2303 // CHECK19-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2304 // CHECK19-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP5]]
2305 // CHECK19-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2306 // CHECK19-NEXT: [[TMP9:%.*]] = load float, ptr [[B]], align 4, !llvm.access.group [[ACC_GRP5]]
2307 // CHECK19-NEXT: [[CONV:%.*]] = fptosi float [[TMP9]] to i32
2308 // CHECK19-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2309 // CHECK19-NEXT: [[TMP10:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP5]]
2310 // CHECK19-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP10]]
2311 // CHECK19-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
2312 // CHECK19-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2313 // CHECK19: omp.body.continue:
2314 // CHECK19-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2315 // CHECK19: omp.inner.for.inc:
2316 // CHECK19-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2317 // CHECK19-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP11]], 1
2318 // CHECK19-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2319 // CHECK19-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
2320 // CHECK19: omp.inner.for.end:
2321 // CHECK19-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2322 // CHECK19: omp.loop.exit:
2323 // CHECK19-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2324 // CHECK19-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2325 // CHECK19-NEXT: [[TMP13:%.*]] = icmp ne i32 [[TMP12]], 0
2326 // CHECK19-NEXT: br i1 [[TMP13]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2327 // CHECK19: .omp.final.then:
2328 // CHECK19-NEXT: store i32 123, ptr [[I]], align 4
2329 // CHECK19-NEXT: br label [[DOTOMP_FINAL_DONE]]
2330 // CHECK19: .omp.final.done:
2331 // CHECK19-NEXT: ret void
2334 // CHECK19-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
2335 // CHECK19-SAME: () #[[ATTR4:[0-9]+]] {
2336 // CHECK19-NEXT: entry:
2337 // CHECK19-NEXT: call void @__tgt_register_requires(i64 1)
2338 // CHECK19-NEXT: ret void
2341 // CHECK21-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2342 // CHECK21-SAME: () #[[ATTR0:[0-9]+]] {
2343 // CHECK21-NEXT: entry:
2344 // CHECK21-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2345 // CHECK21-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2346 // CHECK21-NEXT: ret i32 [[CALL]]
2349 // CHECK21-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2350 // CHECK21-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
2351 // CHECK21-NEXT: entry:
2352 // CHECK21-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2353 // CHECK21-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
2354 // CHECK21-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
2355 // CHECK21-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
2356 // CHECK21-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
2357 // CHECK21-NEXT: [[TMP:%.*]] = alloca i32, align 4
2358 // CHECK21-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2359 // CHECK21-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2360 // CHECK21-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2361 // CHECK21-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2362 // CHECK21-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2363 // CHECK21-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[B]], i32 1
2364 // CHECK21-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[TMP0]] to i64
2365 // CHECK21-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A]] to i64
2366 // CHECK21-NEXT: [[TMP3:%.*]] = sub i64 [[TMP1]], [[TMP2]]
2367 // CHECK21-NEXT: [[TMP4:%.*]] = sdiv exact i64 [[TMP3]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
2368 // CHECK21-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
2369 // CHECK21-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2370 // CHECK21-NEXT: store ptr [[THIS1]], ptr [[TMP5]], align 8
2371 // CHECK21-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2372 // CHECK21-NEXT: store ptr [[A]], ptr [[TMP6]], align 8
2373 // CHECK21-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2374 // CHECK21-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
2375 // CHECK21-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
2376 // CHECK21-NEXT: store ptr null, ptr [[TMP8]], align 8
2377 // CHECK21-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2378 // CHECK21-NEXT: store ptr [[THIS1]], ptr [[TMP9]], align 8
2379 // CHECK21-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2380 // CHECK21-NEXT: store ptr [[B]], ptr [[TMP10]], align 8
2381 // CHECK21-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
2382 // CHECK21-NEXT: store ptr null, ptr [[TMP11]], align 8
2383 // CHECK21-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2384 // CHECK21-NEXT: store ptr [[THIS1]], ptr [[TMP12]], align 8
2385 // CHECK21-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2386 // CHECK21-NEXT: store ptr [[A]], ptr [[TMP13]], align 8
2387 // CHECK21-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
2388 // CHECK21-NEXT: store ptr null, ptr [[TMP14]], align 8
2389 // CHECK21-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2390 // CHECK21-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2391 // CHECK21-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2392 // CHECK21-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2393 // CHECK21-NEXT: store i32 2, ptr [[TMP18]], align 4
2394 // CHECK21-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2395 // CHECK21-NEXT: store i32 3, ptr [[TMP19]], align 4
2396 // CHECK21-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2397 // CHECK21-NEXT: store ptr [[TMP15]], ptr [[TMP20]], align 8
2398 // CHECK21-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2399 // CHECK21-NEXT: store ptr [[TMP16]], ptr [[TMP21]], align 8
2400 // CHECK21-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2401 // CHECK21-NEXT: store ptr [[TMP17]], ptr [[TMP22]], align 8
2402 // CHECK21-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2403 // CHECK21-NEXT: store ptr @.offload_maptypes, ptr [[TMP23]], align 8
2404 // CHECK21-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2405 // CHECK21-NEXT: store ptr null, ptr [[TMP24]], align 8
2406 // CHECK21-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2407 // CHECK21-NEXT: store ptr null, ptr [[TMP25]], align 8
2408 // CHECK21-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2409 // CHECK21-NEXT: store i64 123, ptr [[TMP26]], align 8
2410 // CHECK21-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2411 // CHECK21-NEXT: store i64 0, ptr [[TMP27]], align 8
2412 // CHECK21-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2413 // CHECK21-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
2414 // CHECK21-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2415 // CHECK21-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP29]], align 4
2416 // CHECK21-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2417 // CHECK21-NEXT: store i32 0, ptr [[TMP30]], align 4
2418 // 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]])
2419 // CHECK21-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
2420 // CHECK21-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2421 // CHECK21: omp_offload.failed:
2422 // CHECK21-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123(ptr [[THIS1]]) #[[ATTR2:[0-9]+]]
2423 // CHECK21-NEXT: br label [[OMP_OFFLOAD_CONT]]
2424 // CHECK21: omp_offload.cont:
2425 // CHECK21-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2426 // CHECK21-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i64 0, i64 0
2427 // CHECK21-NEXT: [[TMP33:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2428 // CHECK21-NEXT: ret i32 [[TMP33]]
2431 // CHECK21-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123
2432 // CHECK21-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2433 // CHECK21-NEXT: entry:
2434 // CHECK21-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2435 // CHECK21-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2436 // CHECK21-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
2437 // CHECK21-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2438 // CHECK21-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2439 // CHECK21-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2440 // CHECK21-NEXT: [[TMP1:%.*]] = load float, ptr [[B]], align 4
2441 // CHECK21-NEXT: [[TOBOOL:%.*]] = fcmp une float [[TMP1]], 0.000000e+00
2442 // CHECK21-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
2443 // CHECK21-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
2444 // CHECK21-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2445 // CHECK21-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP2]] to i1
2446 // CHECK21-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
2447 // CHECK21-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
2448 // CHECK21-NEXT: [[TMP3:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
2449 // 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]])
2450 // CHECK21-NEXT: ret void
2453 // CHECK21-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined
2454 // CHECK21-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
2455 // CHECK21-NEXT: entry:
2456 // CHECK21-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2457 // CHECK21-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2458 // CHECK21-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2459 // CHECK21-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
2460 // CHECK21-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2461 // CHECK21-NEXT: [[TMP:%.*]] = alloca i32, align 4
2462 // CHECK21-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2463 // CHECK21-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2464 // CHECK21-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2465 // CHECK21-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2466 // CHECK21-NEXT: [[I:%.*]] = alloca i32, align 4
2467 // CHECK21-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2468 // CHECK21-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2469 // CHECK21-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2470 // CHECK21-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
2471 // CHECK21-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2472 // CHECK21-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2473 // CHECK21-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2474 // CHECK21-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2475 // CHECK21-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2476 // CHECK21-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2477 // CHECK21-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2478 // 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)
2479 // CHECK21-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2480 // CHECK21-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2481 // CHECK21-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2482 // CHECK21: cond.true:
2483 // CHECK21-NEXT: br label [[COND_END:%.*]]
2484 // CHECK21: cond.false:
2485 // CHECK21-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2486 // CHECK21-NEXT: br label [[COND_END]]
2487 // CHECK21: cond.end:
2488 // CHECK21-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2489 // CHECK21-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2490 // CHECK21-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2491 // CHECK21-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2492 // CHECK21-NEXT: [[TMP6:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2493 // CHECK21-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP6]] to i1
2494 // CHECK21-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2495 // CHECK21: omp_if.then:
2496 // CHECK21-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2497 // CHECK21: omp.inner.for.cond:
2498 // CHECK21-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4:![0-9]+]]
2499 // CHECK21-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP4]]
2500 // CHECK21-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2501 // CHECK21-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2502 // CHECK21: omp.inner.for.body:
2503 // CHECK21-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2504 // CHECK21-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2505 // CHECK21-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2506 // CHECK21-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP4]]
2507 // CHECK21-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2508 // CHECK21-NEXT: [[TMP10:%.*]] = load float, ptr [[B]], align 4, !nontemporal !5, !llvm.access.group [[ACC_GRP4]]
2509 // CHECK21-NEXT: [[CONV:%.*]] = fptosi float [[TMP10]] to i32
2510 // CHECK21-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2511 // CHECK21-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP4]]
2512 // CHECK21-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
2513 // CHECK21-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
2514 // CHECK21-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP4]]
2515 // CHECK21-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2516 // CHECK21: omp.body.continue:
2517 // CHECK21-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2518 // CHECK21: omp.inner.for.inc:
2519 // CHECK21-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2520 // CHECK21-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP12]], 1
2521 // CHECK21-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP4]]
2522 // CHECK21-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
2523 // CHECK21: omp.inner.for.end:
2524 // CHECK21-NEXT: br label [[OMP_IF_END:%.*]]
2525 // CHECK21: omp_if.else:
2526 // CHECK21-NEXT: br label [[OMP_INNER_FOR_COND3:%.*]]
2527 // CHECK21: omp.inner.for.cond3:
2528 // CHECK21-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2529 // CHECK21-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2530 // CHECK21-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
2531 // CHECK21-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY5:%.*]], label [[OMP_INNER_FOR_END16:%.*]]
2532 // CHECK21: omp.inner.for.body5:
2533 // CHECK21-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2534 // CHECK21-NEXT: [[MUL6:%.*]] = mul nsw i32 [[TMP15]], 1
2535 // CHECK21-NEXT: [[ADD7:%.*]] = add nsw i32 0, [[MUL6]]
2536 // CHECK21-NEXT: store i32 [[ADD7]], ptr [[I]], align 4
2537 // CHECK21-NEXT: [[B8:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 1
2538 // CHECK21-NEXT: [[TMP16:%.*]] = load float, ptr [[B8]], align 4
2539 // CHECK21-NEXT: [[CONV9:%.*]] = fptosi float [[TMP16]] to i32
2540 // CHECK21-NEXT: [[A10:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2541 // CHECK21-NEXT: [[TMP17:%.*]] = load i32, ptr [[I]], align 4
2542 // CHECK21-NEXT: [[IDXPROM11:%.*]] = sext i32 [[TMP17]] to i64
2543 // CHECK21-NEXT: [[ARRAYIDX12:%.*]] = getelementptr inbounds [123 x i32], ptr [[A10]], i64 0, i64 [[IDXPROM11]]
2544 // CHECK21-NEXT: store i32 [[CONV9]], ptr [[ARRAYIDX12]], align 4
2545 // CHECK21-NEXT: br label [[OMP_BODY_CONTINUE13:%.*]]
2546 // CHECK21: omp.body.continue13:
2547 // CHECK21-NEXT: br label [[OMP_INNER_FOR_INC14:%.*]]
2548 // CHECK21: omp.inner.for.inc14:
2549 // CHECK21-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2550 // CHECK21-NEXT: [[ADD15:%.*]] = add nsw i32 [[TMP18]], 1
2551 // CHECK21-NEXT: store i32 [[ADD15]], ptr [[DOTOMP_IV]], align 4
2552 // CHECK21-NEXT: br label [[OMP_INNER_FOR_COND3]], !llvm.loop [[LOOP9:![0-9]+]]
2553 // CHECK21: omp.inner.for.end16:
2554 // CHECK21-NEXT: br label [[OMP_IF_END]]
2555 // CHECK21: omp_if.end:
2556 // CHECK21-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2557 // CHECK21: omp.loop.exit:
2558 // CHECK21-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2559 // CHECK21-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2560 // CHECK21-NEXT: [[TMP20:%.*]] = icmp ne i32 [[TMP19]], 0
2561 // CHECK21-NEXT: br i1 [[TMP20]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2562 // CHECK21: .omp.final.then:
2563 // CHECK21-NEXT: store i32 123, ptr [[I]], align 4
2564 // CHECK21-NEXT: br label [[DOTOMP_FINAL_DONE]]
2565 // CHECK21: .omp.final.done:
2566 // CHECK21-NEXT: ret void
2569 // CHECK21-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
2570 // CHECK21-SAME: () #[[ATTR4:[0-9]+]] {
2571 // CHECK21-NEXT: entry:
2572 // CHECK21-NEXT: call void @__tgt_register_requires(i64 1)
2573 // CHECK21-NEXT: ret void
2576 // CHECK23-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2577 // CHECK23-SAME: () #[[ATTR0:[0-9]+]] {
2578 // CHECK23-NEXT: entry:
2579 // CHECK23-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2580 // CHECK23-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2581 // CHECK23-NEXT: ret i32 [[CALL]]
2584 // CHECK23-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2585 // CHECK23-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
2586 // CHECK23-NEXT: entry:
2587 // CHECK23-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2588 // CHECK23-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
2589 // CHECK23-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
2590 // CHECK23-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
2591 // CHECK23-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
2592 // CHECK23-NEXT: [[TMP:%.*]] = alloca i32, align 4
2593 // CHECK23-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2594 // CHECK23-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2595 // CHECK23-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2596 // CHECK23-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2597 // CHECK23-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2598 // CHECK23-NEXT: [[TMP0:%.*]] = getelementptr float, ptr [[B]], i32 1
2599 // CHECK23-NEXT: [[TMP1:%.*]] = ptrtoint ptr [[TMP0]] to i64
2600 // CHECK23-NEXT: [[TMP2:%.*]] = ptrtoint ptr [[A]] to i64
2601 // CHECK23-NEXT: [[TMP3:%.*]] = sub i64 [[TMP1]], [[TMP2]]
2602 // CHECK23-NEXT: [[TMP4:%.*]] = sdiv exact i64 [[TMP3]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
2603 // CHECK23-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
2604 // CHECK23-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2605 // CHECK23-NEXT: store ptr [[THIS1]], ptr [[TMP5]], align 4
2606 // CHECK23-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2607 // CHECK23-NEXT: store ptr [[A]], ptr [[TMP6]], align 4
2608 // CHECK23-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2609 // CHECK23-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 4
2610 // CHECK23-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
2611 // CHECK23-NEXT: store ptr null, ptr [[TMP8]], align 4
2612 // CHECK23-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2613 // CHECK23-NEXT: store ptr [[THIS1]], ptr [[TMP9]], align 4
2614 // CHECK23-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2615 // CHECK23-NEXT: store ptr [[B]], ptr [[TMP10]], align 4
2616 // CHECK23-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
2617 // CHECK23-NEXT: store ptr null, ptr [[TMP11]], align 4
2618 // CHECK23-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2619 // CHECK23-NEXT: store ptr [[THIS1]], ptr [[TMP12]], align 4
2620 // CHECK23-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2621 // CHECK23-NEXT: store ptr [[A]], ptr [[TMP13]], align 4
2622 // CHECK23-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
2623 // CHECK23-NEXT: store ptr null, ptr [[TMP14]], align 4
2624 // CHECK23-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2625 // CHECK23-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2626 // CHECK23-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2627 // CHECK23-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2628 // CHECK23-NEXT: store i32 2, ptr [[TMP18]], align 4
2629 // CHECK23-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2630 // CHECK23-NEXT: store i32 3, ptr [[TMP19]], align 4
2631 // CHECK23-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2632 // CHECK23-NEXT: store ptr [[TMP15]], ptr [[TMP20]], align 4
2633 // CHECK23-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2634 // CHECK23-NEXT: store ptr [[TMP16]], ptr [[TMP21]], align 4
2635 // CHECK23-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2636 // CHECK23-NEXT: store ptr [[TMP17]], ptr [[TMP22]], align 4
2637 // CHECK23-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2638 // CHECK23-NEXT: store ptr @.offload_maptypes, ptr [[TMP23]], align 4
2639 // CHECK23-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2640 // CHECK23-NEXT: store ptr null, ptr [[TMP24]], align 4
2641 // CHECK23-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2642 // CHECK23-NEXT: store ptr null, ptr [[TMP25]], align 4
2643 // CHECK23-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2644 // CHECK23-NEXT: store i64 123, ptr [[TMP26]], align 8
2645 // CHECK23-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2646 // CHECK23-NEXT: store i64 0, ptr [[TMP27]], align 8
2647 // CHECK23-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2648 // CHECK23-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
2649 // CHECK23-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2650 // CHECK23-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP29]], align 4
2651 // CHECK23-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2652 // CHECK23-NEXT: store i32 0, ptr [[TMP30]], align 4
2653 // 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]])
2654 // CHECK23-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
2655 // CHECK23-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2656 // CHECK23: omp_offload.failed:
2657 // CHECK23-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123(ptr [[THIS1]]) #[[ATTR2:[0-9]+]]
2658 // CHECK23-NEXT: br label [[OMP_OFFLOAD_CONT]]
2659 // CHECK23: omp_offload.cont:
2660 // CHECK23-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2661 // CHECK23-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i32 0, i32 0
2662 // CHECK23-NEXT: [[TMP33:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2663 // CHECK23-NEXT: ret i32 [[TMP33]]
2666 // CHECK23-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123
2667 // CHECK23-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2668 // CHECK23-NEXT: entry:
2669 // CHECK23-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2670 // CHECK23-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2671 // CHECK23-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
2672 // CHECK23-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2673 // CHECK23-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2674 // CHECK23-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2675 // CHECK23-NEXT: [[TMP1:%.*]] = load float, ptr [[B]], align 4
2676 // CHECK23-NEXT: [[TOBOOL:%.*]] = fcmp une float [[TMP1]], 0.000000e+00
2677 // CHECK23-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
2678 // CHECK23-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
2679 // CHECK23-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2680 // CHECK23-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP2]] to i1
2681 // CHECK23-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
2682 // CHECK23-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
2683 // CHECK23-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR__CASTED]], align 4
2684 // 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]])
2685 // CHECK23-NEXT: ret void
2688 // CHECK23-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l123.omp_outlined
2689 // CHECK23-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
2690 // CHECK23-NEXT: entry:
2691 // CHECK23-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2692 // CHECK23-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2693 // CHECK23-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2694 // CHECK23-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
2695 // CHECK23-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2696 // CHECK23-NEXT: [[TMP:%.*]] = alloca i32, align 4
2697 // CHECK23-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2698 // CHECK23-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2699 // CHECK23-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2700 // CHECK23-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2701 // CHECK23-NEXT: [[I:%.*]] = alloca i32, align 4
2702 // CHECK23-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2703 // CHECK23-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2704 // CHECK23-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2705 // CHECK23-NEXT: store i32 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 4
2706 // CHECK23-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2707 // CHECK23-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2708 // CHECK23-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2709 // CHECK23-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2710 // CHECK23-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2711 // CHECK23-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2712 // CHECK23-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2713 // 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)
2714 // CHECK23-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2715 // CHECK23-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2716 // CHECK23-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2717 // CHECK23: cond.true:
2718 // CHECK23-NEXT: br label [[COND_END:%.*]]
2719 // CHECK23: cond.false:
2720 // CHECK23-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2721 // CHECK23-NEXT: br label [[COND_END]]
2722 // CHECK23: cond.end:
2723 // CHECK23-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2724 // CHECK23-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2725 // CHECK23-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2726 // CHECK23-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2727 // CHECK23-NEXT: [[TMP6:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2728 // CHECK23-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP6]] to i1
2729 // CHECK23-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2730 // CHECK23: omp_if.then:
2731 // CHECK23-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2732 // CHECK23: omp.inner.for.cond:
2733 // CHECK23-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
2734 // CHECK23-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
2735 // CHECK23-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2736 // CHECK23-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2737 // CHECK23: omp.inner.for.body:
2738 // CHECK23-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2739 // CHECK23-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2740 // CHECK23-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2741 // CHECK23-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP5]]
2742 // CHECK23-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 1
2743 // CHECK23-NEXT: [[TMP10:%.*]] = load float, ptr [[B]], align 4, !nontemporal !6, !llvm.access.group [[ACC_GRP5]]
2744 // CHECK23-NEXT: [[CONV:%.*]] = fptosi float [[TMP10]] to i32
2745 // CHECK23-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2746 // CHECK23-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP5]]
2747 // CHECK23-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP11]]
2748 // CHECK23-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
2749 // CHECK23-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2750 // CHECK23: omp.body.continue:
2751 // CHECK23-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2752 // CHECK23: omp.inner.for.inc:
2753 // CHECK23-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2754 // CHECK23-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP12]], 1
2755 // CHECK23-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
2756 // CHECK23-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
2757 // CHECK23: omp.inner.for.end:
2758 // CHECK23-NEXT: br label [[OMP_IF_END:%.*]]
2759 // CHECK23: omp_if.else:
2760 // CHECK23-NEXT: br label [[OMP_INNER_FOR_COND3:%.*]]
2761 // CHECK23: omp.inner.for.cond3:
2762 // CHECK23-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2763 // CHECK23-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2764 // CHECK23-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
2765 // CHECK23-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY5:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
2766 // CHECK23: omp.inner.for.body5:
2767 // CHECK23-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2768 // CHECK23-NEXT: [[MUL6:%.*]] = mul nsw i32 [[TMP15]], 1
2769 // CHECK23-NEXT: [[ADD7:%.*]] = add nsw i32 0, [[MUL6]]
2770 // CHECK23-NEXT: store i32 [[ADD7]], ptr [[I]], align 4
2771 // CHECK23-NEXT: [[B8:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 1
2772 // CHECK23-NEXT: [[TMP16:%.*]] = load float, ptr [[B8]], align 4
2773 // CHECK23-NEXT: [[CONV9:%.*]] = fptosi float [[TMP16]] to i32
2774 // CHECK23-NEXT: [[A10:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[TMP0]], i32 0, i32 0
2775 // CHECK23-NEXT: [[TMP17:%.*]] = load i32, ptr [[I]], align 4
2776 // CHECK23-NEXT: [[ARRAYIDX11:%.*]] = getelementptr inbounds [123 x i32], ptr [[A10]], i32 0, i32 [[TMP17]]
2777 // CHECK23-NEXT: store i32 [[CONV9]], ptr [[ARRAYIDX11]], align 4
2778 // CHECK23-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
2779 // CHECK23: omp.body.continue12:
2780 // CHECK23-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
2781 // CHECK23: omp.inner.for.inc13:
2782 // CHECK23-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2783 // CHECK23-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP18]], 1
2784 // CHECK23-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV]], align 4
2785 // CHECK23-NEXT: br label [[OMP_INNER_FOR_COND3]], !llvm.loop [[LOOP10:![0-9]+]]
2786 // CHECK23: omp.inner.for.end15:
2787 // CHECK23-NEXT: br label [[OMP_IF_END]]
2788 // CHECK23: omp_if.end:
2789 // CHECK23-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2790 // CHECK23: omp.loop.exit:
2791 // CHECK23-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2792 // CHECK23-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2793 // CHECK23-NEXT: [[TMP20:%.*]] = icmp ne i32 [[TMP19]], 0
2794 // CHECK23-NEXT: br i1 [[TMP20]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2795 // CHECK23: .omp.final.then:
2796 // CHECK23-NEXT: store i32 123, ptr [[I]], align 4
2797 // CHECK23-NEXT: br label [[DOTOMP_FINAL_DONE]]
2798 // CHECK23: .omp.final.done:
2799 // CHECK23-NEXT: ret void
2802 // CHECK23-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
2803 // CHECK23-SAME: () #[[ATTR4:[0-9]+]] {
2804 // CHECK23-NEXT: entry:
2805 // CHECK23-NEXT: call void @__tgt_register_requires(i64 1)
2806 // CHECK23-NEXT: ret void
2809 // CHECK25-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2810 // CHECK25-SAME: () #[[ATTR0:[0-9]+]] {
2811 // CHECK25-NEXT: entry:
2812 // CHECK25-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2813 // CHECK25-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2814 // CHECK25-NEXT: ret i32 [[CALL]]
2817 // CHECK25-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2818 // CHECK25-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
2819 // CHECK25-NEXT: entry:
2820 // CHECK25-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2821 // CHECK25-NEXT: [[TMP:%.*]] = alloca i32, align 4
2822 // CHECK25-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2823 // CHECK25-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2824 // CHECK25-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2825 // CHECK25-NEXT: [[I:%.*]] = alloca i32, align 4
2826 // CHECK25-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2827 // CHECK25-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2828 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2829 // CHECK25-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2830 // CHECK25-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2831 // CHECK25-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
2832 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2833 // CHECK25: omp.inner.for.cond:
2834 // CHECK25-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
2835 // CHECK25-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
2836 // CHECK25-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
2837 // CHECK25-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2838 // CHECK25: omp.inner.for.body:
2839 // CHECK25-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2840 // CHECK25-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
2841 // CHECK25-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2842 // CHECK25-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
2843 // CHECK25-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2844 // CHECK25-NEXT: [[TMP4:%.*]] = load float, ptr [[B]], align 4, !llvm.access.group [[ACC_GRP2]]
2845 // CHECK25-NEXT: [[CONV:%.*]] = fptosi float [[TMP4]] to i32
2846 // CHECK25-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2847 // CHECK25-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
2848 // CHECK25-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP5]] to i64
2849 // CHECK25-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
2850 // CHECK25-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
2851 // CHECK25-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2852 // CHECK25: omp.body.continue:
2853 // CHECK25-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2854 // CHECK25: omp.inner.for.inc:
2855 // CHECK25-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2856 // CHECK25-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP6]], 1
2857 // CHECK25-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2858 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
2859 // CHECK25: omp.inner.for.end:
2860 // CHECK25-NEXT: store i32 123, ptr [[I]], align 4
2861 // CHECK25-NEXT: [[A3:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2862 // CHECK25-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [123 x i32], ptr [[A3]], i64 0, i64 0
2863 // CHECK25-NEXT: [[TMP7:%.*]] = load i32, ptr [[ARRAYIDX4]], align 4
2864 // CHECK25-NEXT: ret i32 [[TMP7]]
2867 // CHECK27-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2868 // CHECK27-SAME: () #[[ATTR0:[0-9]+]] {
2869 // CHECK27-NEXT: entry:
2870 // CHECK27-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2871 // CHECK27-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2872 // CHECK27-NEXT: ret i32 [[CALL]]
2875 // CHECK27-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2876 // CHECK27-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
2877 // CHECK27-NEXT: entry:
2878 // CHECK27-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2879 // CHECK27-NEXT: [[TMP:%.*]] = alloca i32, align 4
2880 // CHECK27-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2881 // CHECK27-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2882 // CHECK27-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2883 // CHECK27-NEXT: [[I:%.*]] = alloca i32, align 4
2884 // CHECK27-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2885 // CHECK27-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2886 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2887 // CHECK27-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2888 // CHECK27-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2889 // CHECK27-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
2890 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2891 // CHECK27: omp.inner.for.cond:
2892 // CHECK27-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
2893 // CHECK27-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
2894 // CHECK27-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
2895 // CHECK27-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2896 // CHECK27: omp.inner.for.body:
2897 // CHECK27-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
2898 // CHECK27-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
2899 // CHECK27-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2900 // CHECK27-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP3]]
2901 // CHECK27-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2902 // CHECK27-NEXT: [[TMP4:%.*]] = load float, ptr [[B]], align 4, !llvm.access.group [[ACC_GRP3]]
2903 // CHECK27-NEXT: [[CONV:%.*]] = fptosi float [[TMP4]] to i32
2904 // CHECK27-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2905 // CHECK27-NEXT: [[TMP5:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP3]]
2906 // CHECK27-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP5]]
2907 // CHECK27-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
2908 // CHECK27-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2909 // CHECK27: omp.body.continue:
2910 // CHECK27-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2911 // CHECK27: omp.inner.for.inc:
2912 // CHECK27-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
2913 // CHECK27-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP6]], 1
2914 // CHECK27-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
2915 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
2916 // CHECK27: omp.inner.for.end:
2917 // CHECK27-NEXT: store i32 123, ptr [[I]], align 4
2918 // CHECK27-NEXT: [[A3:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2919 // CHECK27-NEXT: [[ARRAYIDX4:%.*]] = getelementptr inbounds [123 x i32], ptr [[A3]], i32 0, i32 0
2920 // CHECK27-NEXT: [[TMP7:%.*]] = load i32, ptr [[ARRAYIDX4]], align 4
2921 // CHECK27-NEXT: ret i32 [[TMP7]]
2924 // CHECK29-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2925 // CHECK29-SAME: () #[[ATTR0:[0-9]+]] {
2926 // CHECK29-NEXT: entry:
2927 // CHECK29-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2928 // CHECK29-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2929 // CHECK29-NEXT: ret i32 [[CALL]]
2932 // CHECK29-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2933 // CHECK29-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
2934 // CHECK29-NEXT: entry:
2935 // CHECK29-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2936 // CHECK29-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2937 // CHECK29-NEXT: [[TMP:%.*]] = alloca i32, align 4
2938 // CHECK29-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2939 // CHECK29-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2940 // CHECK29-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2941 // CHECK29-NEXT: [[I:%.*]] = alloca i32, align 4
2942 // CHECK29-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2943 // CHECK29-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2944 // CHECK29-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
2945 // CHECK29-NEXT: [[TMP0:%.*]] = load float, ptr [[B]], align 4
2946 // CHECK29-NEXT: [[TOBOOL:%.*]] = fcmp une float [[TMP0]], 0.000000e+00
2947 // CHECK29-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
2948 // CHECK29-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
2949 // CHECK29-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2950 // CHECK29-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2951 // CHECK29-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2952 // CHECK29-NEXT: store i32 [[TMP1]], ptr [[DOTOMP_IV]], align 4
2953 // CHECK29-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2954 // CHECK29-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP2]] to i1
2955 // CHECK29-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2956 // CHECK29: omp_if.then:
2957 // CHECK29-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2958 // CHECK29: omp.inner.for.cond:
2959 // CHECK29-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
2960 // CHECK29-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
2961 // CHECK29-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP3]], [[TMP4]]
2962 // CHECK29-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2963 // CHECK29: omp.inner.for.body:
2964 // CHECK29-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2965 // CHECK29-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP5]], 1
2966 // CHECK29-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2967 // CHECK29-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
2968 // CHECK29-NEXT: [[B3:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
2969 // CHECK29-NEXT: [[TMP6:%.*]] = load float, ptr [[B3]], align 4, !nontemporal !3, !llvm.access.group [[ACC_GRP2]]
2970 // CHECK29-NEXT: [[CONV:%.*]] = fptosi float [[TMP6]] to i32
2971 // CHECK29-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2972 // CHECK29-NEXT: [[TMP7:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
2973 // CHECK29-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP7]] to i64
2974 // CHECK29-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
2975 // CHECK29-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
2976 // CHECK29-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2977 // CHECK29: omp.body.continue:
2978 // CHECK29-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2979 // CHECK29: omp.inner.for.inc:
2980 // CHECK29-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2981 // CHECK29-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP8]], 1
2982 // CHECK29-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
2983 // CHECK29-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
2984 // CHECK29: omp.inner.for.end:
2985 // CHECK29-NEXT: br label [[OMP_IF_END:%.*]]
2986 // CHECK29: omp_if.else:
2987 // CHECK29-NEXT: br label [[OMP_INNER_FOR_COND5:%.*]]
2988 // CHECK29: omp.inner.for.cond5:
2989 // CHECK29-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2990 // CHECK29-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2991 // CHECK29-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
2992 // CHECK29-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY7:%.*]], label [[OMP_INNER_FOR_END18:%.*]]
2993 // CHECK29: omp.inner.for.body7:
2994 // CHECK29-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2995 // CHECK29-NEXT: [[MUL8:%.*]] = mul nsw i32 [[TMP11]], 1
2996 // CHECK29-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
2997 // CHECK29-NEXT: store i32 [[ADD9]], ptr [[I]], align 4
2998 // CHECK29-NEXT: [[B10:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
2999 // CHECK29-NEXT: [[TMP12:%.*]] = load float, ptr [[B10]], align 4
3000 // CHECK29-NEXT: [[CONV11:%.*]] = fptosi float [[TMP12]] to i32
3001 // CHECK29-NEXT: [[A12:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
3002 // CHECK29-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
3003 // CHECK29-NEXT: [[IDXPROM13:%.*]] = sext i32 [[TMP13]] to i64
3004 // CHECK29-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds [123 x i32], ptr [[A12]], i64 0, i64 [[IDXPROM13]]
3005 // CHECK29-NEXT: store i32 [[CONV11]], ptr [[ARRAYIDX14]], align 4
3006 // CHECK29-NEXT: br label [[OMP_BODY_CONTINUE15:%.*]]
3007 // CHECK29: omp.body.continue15:
3008 // CHECK29-NEXT: br label [[OMP_INNER_FOR_INC16:%.*]]
3009 // CHECK29: omp.inner.for.inc16:
3010 // CHECK29-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3011 // CHECK29-NEXT: [[ADD17:%.*]] = add nsw i32 [[TMP14]], 1
3012 // CHECK29-NEXT: store i32 [[ADD17]], ptr [[DOTOMP_IV]], align 4
3013 // CHECK29-NEXT: br label [[OMP_INNER_FOR_COND5]], !llvm.loop [[LOOP7:![0-9]+]]
3014 // CHECK29: omp.inner.for.end18:
3015 // CHECK29-NEXT: br label [[OMP_IF_END]]
3016 // CHECK29: omp_if.end:
3017 // CHECK29-NEXT: store i32 123, ptr [[I]], align 4
3018 // CHECK29-NEXT: [[A19:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
3019 // CHECK29-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds [123 x i32], ptr [[A19]], i64 0, i64 0
3020 // CHECK29-NEXT: [[TMP15:%.*]] = load i32, ptr [[ARRAYIDX20]], align 4
3021 // CHECK29-NEXT: ret i32 [[TMP15]]
3024 // CHECK31-LABEL: define {{[^@]+}}@_Z21teams_template_structv
3025 // CHECK31-SAME: () #[[ATTR0:[0-9]+]] {
3026 // CHECK31-NEXT: entry:
3027 // CHECK31-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
3028 // CHECK31-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
3029 // CHECK31-NEXT: ret i32 [[CALL]]
3032 // CHECK31-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
3033 // CHECK31-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
3034 // CHECK31-NEXT: entry:
3035 // CHECK31-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
3036 // CHECK31-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
3037 // CHECK31-NEXT: [[TMP:%.*]] = alloca i32, align 4
3038 // CHECK31-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3039 // CHECK31-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3040 // CHECK31-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3041 // CHECK31-NEXT: [[I:%.*]] = alloca i32, align 4
3042 // CHECK31-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
3043 // CHECK31-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
3044 // CHECK31-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 1
3045 // CHECK31-NEXT: [[TMP0:%.*]] = load float, ptr [[B]], align 4
3046 // CHECK31-NEXT: [[TOBOOL:%.*]] = fcmp une float [[TMP0]], 0.000000e+00
3047 // CHECK31-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
3048 // CHECK31-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
3049 // CHECK31-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3050 // CHECK31-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
3051 // CHECK31-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3052 // CHECK31-NEXT: store i32 [[TMP1]], ptr [[DOTOMP_IV]], align 4
3053 // CHECK31-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
3054 // CHECK31-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP2]] to i1
3055 // CHECK31-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
3056 // CHECK31: omp_if.then:
3057 // CHECK31-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3058 // CHECK31: omp.inner.for.cond:
3059 // CHECK31-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
3060 // CHECK31-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
3061 // CHECK31-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP3]], [[TMP4]]
3062 // CHECK31-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3063 // CHECK31: omp.inner.for.body:
3064 // CHECK31-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
3065 // CHECK31-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP5]], 1
3066 // CHECK31-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3067 // CHECK31-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP3]]
3068 // CHECK31-NEXT: [[B3:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
3069 // CHECK31-NEXT: [[TMP6:%.*]] = load float, ptr [[B3]], align 4, !nontemporal !4, !llvm.access.group [[ACC_GRP3]]
3070 // CHECK31-NEXT: [[CONV:%.*]] = fptosi float [[TMP6]] to i32
3071 // CHECK31-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
3072 // CHECK31-NEXT: [[TMP7:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP3]]
3073 // CHECK31-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP7]]
3074 // CHECK31-NEXT: store i32 [[CONV]], ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
3075 // CHECK31-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3076 // CHECK31: omp.body.continue:
3077 // CHECK31-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3078 // CHECK31: omp.inner.for.inc:
3079 // CHECK31-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
3080 // CHECK31-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP8]], 1
3081 // CHECK31-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
3082 // CHECK31-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP5:![0-9]+]]
3083 // CHECK31: omp.inner.for.end:
3084 // CHECK31-NEXT: br label [[OMP_IF_END:%.*]]
3085 // CHECK31: omp_if.else:
3086 // CHECK31-NEXT: br label [[OMP_INNER_FOR_COND5:%.*]]
3087 // CHECK31: omp.inner.for.cond5:
3088 // CHECK31-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3089 // CHECK31-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3090 // CHECK31-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
3091 // CHECK31-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY7:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
3092 // CHECK31: omp.inner.for.body7:
3093 // CHECK31-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3094 // CHECK31-NEXT: [[MUL8:%.*]] = mul nsw i32 [[TMP11]], 1
3095 // CHECK31-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
3096 // CHECK31-NEXT: store i32 [[ADD9]], ptr [[I]], align 4
3097 // CHECK31-NEXT: [[B10:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 1
3098 // CHECK31-NEXT: [[TMP12:%.*]] = load float, ptr [[B10]], align 4
3099 // CHECK31-NEXT: [[CONV11:%.*]] = fptosi float [[TMP12]] to i32
3100 // CHECK31-NEXT: [[A12:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
3101 // CHECK31-NEXT: [[TMP13:%.*]] = load i32, ptr [[I]], align 4
3102 // CHECK31-NEXT: [[ARRAYIDX13:%.*]] = getelementptr inbounds [123 x i32], ptr [[A12]], i32 0, i32 [[TMP13]]
3103 // CHECK31-NEXT: store i32 [[CONV11]], ptr [[ARRAYIDX13]], align 4
3104 // CHECK31-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
3105 // CHECK31: omp.body.continue14:
3106 // CHECK31-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
3107 // CHECK31: omp.inner.for.inc15:
3108 // CHECK31-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3109 // CHECK31-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP14]], 1
3110 // CHECK31-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
3111 // CHECK31-NEXT: br label [[OMP_INNER_FOR_COND5]], !llvm.loop [[LOOP8:![0-9]+]]
3112 // CHECK31: omp.inner.for.end17:
3113 // CHECK31-NEXT: br label [[OMP_IF_END]]
3114 // CHECK31: omp_if.end:
3115 // CHECK31-NEXT: store i32 123, ptr [[I]], align 4
3116 // CHECK31-NEXT: [[A18:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
3117 // CHECK31-NEXT: [[ARRAYIDX19:%.*]] = getelementptr inbounds [123 x i32], ptr [[A18]], i32 0, i32 0
3118 // CHECK31-NEXT: [[TMP15:%.*]] = load i32, ptr [[ARRAYIDX19]], align 4
3119 // CHECK31-NEXT: ret i32 [[TMP15]]
3122 // CHECK33-LABEL: define {{[^@]+}}@main
3123 // CHECK33-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
3124 // CHECK33-NEXT: entry:
3125 // CHECK33-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3126 // CHECK33-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3127 // CHECK33-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
3128 // CHECK33-NEXT: [[N:%.*]] = alloca i32, align 4
3129 // CHECK33-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
3130 // CHECK33-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
3131 // CHECK33-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
3132 // CHECK33-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
3133 // CHECK33-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
3134 // CHECK33-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
3135 // CHECK33-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
3136 // CHECK33-NEXT: [[TMP:%.*]] = alloca i32, align 4
3137 // CHECK33-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3138 // CHECK33-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3139 // CHECK33-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3140 // CHECK33-NEXT: store i32 0, ptr [[RETVAL]], align 4
3141 // CHECK33-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3142 // CHECK33-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
3143 // CHECK33-NEXT: store i32 100, ptr [[N]], align 4
3144 // CHECK33-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
3145 // CHECK33-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
3146 // CHECK33-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
3147 // CHECK33-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
3148 // CHECK33-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
3149 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
3150 // CHECK33-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
3151 // CHECK33-NEXT: store i32 [[TMP3]], ptr [[N_CASTED]], align 4
3152 // CHECK33-NEXT: [[TMP4:%.*]] = load i64, ptr [[N_CASTED]], align 8
3153 // CHECK33-NEXT: [[TMP5:%.*]] = mul nuw i64 [[TMP1]], 4
3154 // CHECK33-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
3155 // CHECK33-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3156 // CHECK33-NEXT: store i64 [[TMP4]], ptr [[TMP6]], align 8
3157 // CHECK33-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3158 // CHECK33-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
3159 // CHECK33-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
3160 // CHECK33-NEXT: store ptr null, ptr [[TMP8]], align 8
3161 // CHECK33-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3162 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[TMP9]], align 8
3163 // CHECK33-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3164 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[TMP10]], align 8
3165 // CHECK33-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
3166 // CHECK33-NEXT: store ptr null, ptr [[TMP11]], align 8
3167 // CHECK33-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3168 // CHECK33-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 8
3169 // CHECK33-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3170 // CHECK33-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 8
3171 // CHECK33-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
3172 // CHECK33-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 8
3173 // CHECK33-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
3174 // CHECK33-NEXT: store ptr null, ptr [[TMP15]], align 8
3175 // CHECK33-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3176 // CHECK33-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3177 // CHECK33-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
3178 // CHECK33-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
3179 // CHECK33-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
3180 // CHECK33-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3181 // CHECK33-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
3182 // CHECK33-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3183 // CHECK33-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3184 // CHECK33-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3185 // CHECK33-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3186 // CHECK33-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
3187 // CHECK33-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
3188 // CHECK33-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3189 // CHECK33-NEXT: store i32 2, ptr [[TMP23]], align 4
3190 // CHECK33-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3191 // CHECK33-NEXT: store i32 3, ptr [[TMP24]], align 4
3192 // CHECK33-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3193 // CHECK33-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 8
3194 // CHECK33-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3195 // CHECK33-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 8
3196 // CHECK33-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3197 // CHECK33-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 8
3198 // CHECK33-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3199 // CHECK33-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 8
3200 // CHECK33-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3201 // CHECK33-NEXT: store ptr null, ptr [[TMP29]], align 8
3202 // CHECK33-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3203 // CHECK33-NEXT: store ptr null, ptr [[TMP30]], align 8
3204 // CHECK33-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3205 // CHECK33-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
3206 // CHECK33-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3207 // CHECK33-NEXT: store i64 0, ptr [[TMP32]], align 8
3208 // CHECK33-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3209 // CHECK33-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
3210 // CHECK33-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3211 // CHECK33-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP34]], align 4
3212 // CHECK33-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3213 // CHECK33-NEXT: store i32 0, ptr [[TMP35]], align 4
3214 // 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]])
3215 // CHECK33-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
3216 // CHECK33-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3217 // CHECK33: omp_offload.failed:
3218 // CHECK33-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192(i64 [[TMP4]], i64 [[TMP1]], ptr [[VLA]]) #[[ATTR3:[0-9]+]]
3219 // CHECK33-NEXT: br label [[OMP_OFFLOAD_CONT]]
3220 // CHECK33: omp_offload.cont:
3221 // CHECK33-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
3222 // CHECK33-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP38]])
3223 // CHECK33-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
3224 // CHECK33-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
3225 // CHECK33-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
3226 // CHECK33-NEXT: [[TMP40:%.*]] = load i32, ptr [[RETVAL]], align 4
3227 // CHECK33-NEXT: ret i32 [[TMP40]]
3230 // CHECK33-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192
3231 // CHECK33-SAME: (i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
3232 // CHECK33-NEXT: entry:
3233 // CHECK33-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
3234 // CHECK33-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
3235 // CHECK33-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
3236 // CHECK33-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
3237 // CHECK33-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
3238 // CHECK33-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
3239 // CHECK33-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
3240 // CHECK33-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
3241 // 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]])
3242 // CHECK33-NEXT: ret void
3245 // CHECK33-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined
3246 // 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]] {
3247 // CHECK33-NEXT: entry:
3248 // CHECK33-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3249 // CHECK33-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3250 // CHECK33-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
3251 // CHECK33-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
3252 // CHECK33-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
3253 // CHECK33-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3254 // CHECK33-NEXT: [[TMP:%.*]] = alloca i32, align 4
3255 // CHECK33-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3256 // CHECK33-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3257 // CHECK33-NEXT: [[I:%.*]] = alloca i32, align 4
3258 // CHECK33-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3259 // CHECK33-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3260 // CHECK33-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3261 // CHECK33-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3262 // CHECK33-NEXT: [[I3:%.*]] = alloca i32, align 4
3263 // CHECK33-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3264 // CHECK33-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3265 // CHECK33-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
3266 // CHECK33-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
3267 // CHECK33-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
3268 // CHECK33-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
3269 // CHECK33-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
3270 // CHECK33-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
3271 // CHECK33-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
3272 // CHECK33-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
3273 // CHECK33-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3274 // CHECK33-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
3275 // CHECK33-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3276 // CHECK33-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3277 // CHECK33-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3278 // CHECK33-NEXT: store i32 0, ptr [[I]], align 4
3279 // CHECK33-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3280 // CHECK33-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
3281 // CHECK33-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
3282 // CHECK33: omp.precond.then:
3283 // CHECK33-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3284 // CHECK33-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3285 // CHECK33-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
3286 // CHECK33-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3287 // CHECK33-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3288 // CHECK33-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3289 // CHECK33-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
3290 // 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)
3291 // CHECK33-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3292 // CHECK33-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3293 // CHECK33-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
3294 // CHECK33-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3295 // CHECK33: cond.true:
3296 // CHECK33-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3297 // CHECK33-NEXT: br label [[COND_END:%.*]]
3298 // CHECK33: cond.false:
3299 // CHECK33-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3300 // CHECK33-NEXT: br label [[COND_END]]
3301 // CHECK33: cond.end:
3302 // CHECK33-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
3303 // CHECK33-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3304 // CHECK33-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3305 // CHECK33-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
3306 // CHECK33-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3307 // CHECK33: omp.inner.for.cond:
3308 // CHECK33-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
3309 // CHECK33-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
3310 // CHECK33-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
3311 // CHECK33-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3312 // CHECK33: omp.inner.for.body:
3313 // CHECK33-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
3314 // CHECK33-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
3315 // CHECK33-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3316 // CHECK33-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP5]]
3317 // CHECK33-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP5]]
3318 // CHECK33-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
3319 // CHECK33-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
3320 // CHECK33-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
3321 // CHECK33-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3322 // CHECK33: omp.body.continue:
3323 // CHECK33-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3324 // CHECK33: omp.inner.for.inc:
3325 // CHECK33-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
3326 // CHECK33-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
3327 // CHECK33-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
3328 // CHECK33-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
3329 // CHECK33: omp.inner.for.end:
3330 // CHECK33-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3331 // CHECK33: omp.loop.exit:
3332 // CHECK33-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3333 // CHECK33-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
3334 // CHECK33-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
3335 // CHECK33-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3336 // CHECK33-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
3337 // CHECK33-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3338 // CHECK33: .omp.final.then:
3339 // CHECK33-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3340 // CHECK33-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP23]], 0
3341 // CHECK33-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
3342 // CHECK33-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
3343 // CHECK33-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
3344 // CHECK33-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
3345 // CHECK33-NEXT: br label [[DOTOMP_FINAL_DONE]]
3346 // CHECK33: .omp.final.done:
3347 // CHECK33-NEXT: br label [[OMP_PRECOND_END]]
3348 // CHECK33: omp.precond.end:
3349 // CHECK33-NEXT: ret void
3352 // CHECK33-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
3353 // CHECK33-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat {
3354 // CHECK33-NEXT: entry:
3355 // CHECK33-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3356 // CHECK33-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
3357 // CHECK33-NEXT: [[TE:%.*]] = alloca i32, align 4
3358 // CHECK33-NEXT: [[TH:%.*]] = alloca i32, align 4
3359 // CHECK33-NEXT: [[TE_CASTED:%.*]] = alloca i64, align 8
3360 // CHECK33-NEXT: [[TH_CASTED:%.*]] = alloca i64, align 8
3361 // CHECK33-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
3362 // CHECK33-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
3363 // CHECK33-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
3364 // CHECK33-NEXT: [[TMP:%.*]] = alloca i32, align 4
3365 // CHECK33-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3366 // CHECK33-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3367 // CHECK33-NEXT: store i32 0, ptr [[TE]], align 4
3368 // CHECK33-NEXT: store i32 128, ptr [[TH]], align 4
3369 // CHECK33-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
3370 // CHECK33-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
3371 // CHECK33-NEXT: [[TMP1:%.*]] = load i64, ptr [[TE_CASTED]], align 8
3372 // CHECK33-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
3373 // CHECK33-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
3374 // CHECK33-NEXT: [[TMP3:%.*]] = load i64, ptr [[TH_CASTED]], align 8
3375 // CHECK33-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3376 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[TMP4]], align 8
3377 // CHECK33-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3378 // CHECK33-NEXT: store i64 [[TMP1]], ptr [[TMP5]], align 8
3379 // CHECK33-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
3380 // CHECK33-NEXT: store ptr null, ptr [[TMP6]], align 8
3381 // CHECK33-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3382 // CHECK33-NEXT: store i64 [[TMP3]], ptr [[TMP7]], align 8
3383 // CHECK33-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3384 // CHECK33-NEXT: store i64 [[TMP3]], ptr [[TMP8]], align 8
3385 // CHECK33-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
3386 // CHECK33-NEXT: store ptr null, ptr [[TMP9]], align 8
3387 // CHECK33-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3388 // CHECK33-NEXT: store ptr [[A]], ptr [[TMP10]], align 8
3389 // CHECK33-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3390 // CHECK33-NEXT: store ptr [[A]], ptr [[TMP11]], align 8
3391 // CHECK33-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
3392 // CHECK33-NEXT: store ptr null, ptr [[TMP12]], align 8
3393 // CHECK33-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3394 // CHECK33-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3395 // CHECK33-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
3396 // CHECK33-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
3397 // CHECK33-NEXT: [[TMP17:%.*]] = icmp ult i32 [[TMP16]], 1
3398 // CHECK33-NEXT: [[TMP18:%.*]] = select i1 [[TMP17]], i32 [[TMP16]], i32 1
3399 // CHECK33-NEXT: [[TMP19:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
3400 // CHECK33-NEXT: [[TMP20:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP18]], 0
3401 // CHECK33-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3402 // CHECK33-NEXT: store i32 2, ptr [[TMP21]], align 4
3403 // CHECK33-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3404 // CHECK33-NEXT: store i32 3, ptr [[TMP22]], align 4
3405 // CHECK33-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3406 // CHECK33-NEXT: store ptr [[TMP13]], ptr [[TMP23]], align 8
3407 // CHECK33-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3408 // CHECK33-NEXT: store ptr [[TMP14]], ptr [[TMP24]], align 8
3409 // CHECK33-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3410 // CHECK33-NEXT: store ptr @.offload_sizes.1, ptr [[TMP25]], align 8
3411 // CHECK33-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3412 // CHECK33-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP26]], align 8
3413 // CHECK33-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3414 // CHECK33-NEXT: store ptr null, ptr [[TMP27]], align 8
3415 // CHECK33-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3416 // CHECK33-NEXT: store ptr null, ptr [[TMP28]], align 8
3417 // CHECK33-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3418 // CHECK33-NEXT: store i64 10, ptr [[TMP29]], align 8
3419 // CHECK33-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3420 // CHECK33-NEXT: store i64 0, ptr [[TMP30]], align 8
3421 // CHECK33-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3422 // CHECK33-NEXT: store [3 x i32] [[TMP19]], ptr [[TMP31]], align 4
3423 // CHECK33-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3424 // CHECK33-NEXT: store [3 x i32] [[TMP20]], ptr [[TMP32]], align 4
3425 // CHECK33-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3426 // CHECK33-NEXT: store i32 0, ptr [[TMP33]], align 4
3427 // 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]])
3428 // CHECK33-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
3429 // CHECK33-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3430 // CHECK33: omp_offload.failed:
3431 // CHECK33-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181(i64 [[TMP1]], i64 [[TMP3]], ptr [[A]]) #[[ATTR3]]
3432 // CHECK33-NEXT: br label [[OMP_OFFLOAD_CONT]]
3433 // CHECK33: omp_offload.cont:
3434 // CHECK33-NEXT: ret i32 0
3437 // CHECK33-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181
3438 // CHECK33-SAME: (i64 noundef [[TE:%.*]], i64 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
3439 // CHECK33-NEXT: entry:
3440 // CHECK33-NEXT: [[TE_ADDR:%.*]] = alloca i64, align 8
3441 // CHECK33-NEXT: [[TH_ADDR:%.*]] = alloca i64, align 8
3442 // CHECK33-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
3443 // CHECK33-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
3444 // CHECK33-NEXT: store i64 [[TE]], ptr [[TE_ADDR]], align 8
3445 // CHECK33-NEXT: store i64 [[TH]], ptr [[TH_ADDR]], align 8
3446 // CHECK33-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
3447 // CHECK33-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
3448 // CHECK33-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
3449 // CHECK33-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
3450 // CHECK33-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
3451 // 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]])
3452 // CHECK33-NEXT: ret void
3455 // CHECK33-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined
3456 // CHECK33-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
3457 // CHECK33-NEXT: entry:
3458 // CHECK33-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3459 // CHECK33-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3460 // CHECK33-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
3461 // CHECK33-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3462 // CHECK33-NEXT: [[TMP:%.*]] = alloca i32, align 4
3463 // CHECK33-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3464 // CHECK33-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3465 // CHECK33-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3466 // CHECK33-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3467 // CHECK33-NEXT: [[I:%.*]] = alloca i32, align 4
3468 // CHECK33-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3469 // CHECK33-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3470 // CHECK33-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
3471 // CHECK33-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
3472 // CHECK33-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3473 // CHECK33-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
3474 // CHECK33-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3475 // CHECK33-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3476 // CHECK33-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3477 // CHECK33-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
3478 // 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)
3479 // CHECK33-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3480 // CHECK33-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
3481 // CHECK33-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3482 // CHECK33: cond.true:
3483 // CHECK33-NEXT: br label [[COND_END:%.*]]
3484 // CHECK33: cond.false:
3485 // CHECK33-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3486 // CHECK33-NEXT: br label [[COND_END]]
3487 // CHECK33: cond.end:
3488 // CHECK33-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
3489 // CHECK33-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3490 // CHECK33-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3491 // CHECK33-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
3492 // CHECK33-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3493 // CHECK33: omp.inner.for.cond:
3494 // CHECK33-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
3495 // CHECK33-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
3496 // CHECK33-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3497 // CHECK33-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3498 // CHECK33: omp.inner.for.body:
3499 // CHECK33-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
3500 // CHECK33-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
3501 // CHECK33-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3502 // CHECK33-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP11]]
3503 // CHECK33-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP11]]
3504 // CHECK33-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
3505 // CHECK33-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i64 0, i64 [[IDXPROM]]
3506 // CHECK33-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP11]]
3507 // CHECK33-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3508 // CHECK33: omp.body.continue:
3509 // CHECK33-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3510 // CHECK33: omp.inner.for.inc:
3511 // CHECK33-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
3512 // CHECK33-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
3513 // CHECK33-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
3514 // CHECK33-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
3515 // CHECK33: omp.inner.for.end:
3516 // CHECK33-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3517 // CHECK33: omp.loop.exit:
3518 // CHECK33-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
3519 // CHECK33-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3520 // CHECK33-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3521 // CHECK33-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3522 // CHECK33: .omp.final.then:
3523 // CHECK33-NEXT: store i32 10, ptr [[I]], align 4
3524 // CHECK33-NEXT: br label [[DOTOMP_FINAL_DONE]]
3525 // CHECK33: .omp.final.done:
3526 // CHECK33-NEXT: ret void
3529 // CHECK33-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
3530 // CHECK33-SAME: () #[[ATTR6:[0-9]+]] {
3531 // CHECK33-NEXT: entry:
3532 // CHECK33-NEXT: call void @__tgt_register_requires(i64 1)
3533 // CHECK33-NEXT: ret void
3536 // CHECK35-LABEL: define {{[^@]+}}@main
3537 // CHECK35-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
3538 // CHECK35-NEXT: entry:
3539 // CHECK35-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3540 // CHECK35-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3541 // CHECK35-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
3542 // CHECK35-NEXT: [[N:%.*]] = alloca i32, align 4
3543 // CHECK35-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
3544 // CHECK35-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
3545 // CHECK35-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
3546 // CHECK35-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
3547 // CHECK35-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
3548 // CHECK35-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
3549 // CHECK35-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
3550 // CHECK35-NEXT: [[TMP:%.*]] = alloca i32, align 4
3551 // CHECK35-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3552 // CHECK35-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3553 // CHECK35-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3554 // CHECK35-NEXT: store i32 0, ptr [[RETVAL]], align 4
3555 // CHECK35-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3556 // CHECK35-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
3557 // CHECK35-NEXT: store i32 100, ptr [[N]], align 4
3558 // CHECK35-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
3559 // CHECK35-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
3560 // CHECK35-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
3561 // CHECK35-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
3562 // CHECK35-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
3563 // CHECK35-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
3564 // CHECK35-NEXT: store i32 [[TMP2]], ptr [[N_CASTED]], align 4
3565 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[N_CASTED]], align 4
3566 // CHECK35-NEXT: [[TMP4:%.*]] = mul nuw i32 [[TMP0]], 4
3567 // CHECK35-NEXT: [[TMP5:%.*]] = sext i32 [[TMP4]] to i64
3568 // CHECK35-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
3569 // CHECK35-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3570 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[TMP6]], align 4
3571 // CHECK35-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3572 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
3573 // CHECK35-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
3574 // CHECK35-NEXT: store ptr null, ptr [[TMP8]], align 4
3575 // CHECK35-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3576 // CHECK35-NEXT: store i32 [[TMP0]], ptr [[TMP9]], align 4
3577 // CHECK35-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3578 // CHECK35-NEXT: store i32 [[TMP0]], ptr [[TMP10]], align 4
3579 // CHECK35-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
3580 // CHECK35-NEXT: store ptr null, ptr [[TMP11]], align 4
3581 // CHECK35-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3582 // CHECK35-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 4
3583 // CHECK35-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3584 // CHECK35-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 4
3585 // CHECK35-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
3586 // CHECK35-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 4
3587 // CHECK35-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
3588 // CHECK35-NEXT: store ptr null, ptr [[TMP15]], align 4
3589 // CHECK35-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3590 // CHECK35-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3591 // CHECK35-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
3592 // CHECK35-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
3593 // CHECK35-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
3594 // CHECK35-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3595 // CHECK35-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
3596 // CHECK35-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3597 // CHECK35-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3598 // CHECK35-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3599 // CHECK35-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3600 // CHECK35-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
3601 // CHECK35-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
3602 // CHECK35-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3603 // CHECK35-NEXT: store i32 2, ptr [[TMP23]], align 4
3604 // CHECK35-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3605 // CHECK35-NEXT: store i32 3, ptr [[TMP24]], align 4
3606 // CHECK35-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3607 // CHECK35-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 4
3608 // CHECK35-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3609 // CHECK35-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 4
3610 // CHECK35-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3611 // CHECK35-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 4
3612 // CHECK35-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3613 // CHECK35-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 4
3614 // CHECK35-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3615 // CHECK35-NEXT: store ptr null, ptr [[TMP29]], align 4
3616 // CHECK35-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3617 // CHECK35-NEXT: store ptr null, ptr [[TMP30]], align 4
3618 // CHECK35-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3619 // CHECK35-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
3620 // CHECK35-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3621 // CHECK35-NEXT: store i64 0, ptr [[TMP32]], align 8
3622 // CHECK35-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3623 // CHECK35-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
3624 // CHECK35-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3625 // CHECK35-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP34]], align 4
3626 // CHECK35-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3627 // CHECK35-NEXT: store i32 0, ptr [[TMP35]], align 4
3628 // 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]])
3629 // CHECK35-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
3630 // CHECK35-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3631 // CHECK35: omp_offload.failed:
3632 // CHECK35-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192(i32 [[TMP3]], i32 [[TMP0]], ptr [[VLA]]) #[[ATTR3:[0-9]+]]
3633 // CHECK35-NEXT: br label [[OMP_OFFLOAD_CONT]]
3634 // CHECK35: omp_offload.cont:
3635 // CHECK35-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
3636 // CHECK35-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP38]])
3637 // CHECK35-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
3638 // CHECK35-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
3639 // CHECK35-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
3640 // CHECK35-NEXT: [[TMP40:%.*]] = load i32, ptr [[RETVAL]], align 4
3641 // CHECK35-NEXT: ret i32 [[TMP40]]
3644 // CHECK35-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192
3645 // CHECK35-SAME: (i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
3646 // CHECK35-NEXT: entry:
3647 // CHECK35-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
3648 // CHECK35-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
3649 // CHECK35-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3650 // CHECK35-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
3651 // CHECK35-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
3652 // CHECK35-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3653 // CHECK35-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
3654 // CHECK35-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3655 // 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]])
3656 // CHECK35-NEXT: ret void
3659 // CHECK35-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined
3660 // 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]] {
3661 // CHECK35-NEXT: entry:
3662 // CHECK35-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3663 // CHECK35-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3664 // CHECK35-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
3665 // CHECK35-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
3666 // CHECK35-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3667 // CHECK35-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3668 // CHECK35-NEXT: [[TMP:%.*]] = alloca i32, align 4
3669 // CHECK35-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3670 // CHECK35-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3671 // CHECK35-NEXT: [[I:%.*]] = alloca i32, align 4
3672 // CHECK35-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3673 // CHECK35-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3674 // CHECK35-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3675 // CHECK35-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3676 // CHECK35-NEXT: [[I3:%.*]] = alloca i32, align 4
3677 // CHECK35-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3678 // CHECK35-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3679 // CHECK35-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
3680 // CHECK35-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
3681 // CHECK35-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3682 // CHECK35-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
3683 // CHECK35-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
3684 // CHECK35-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3685 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
3686 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
3687 // CHECK35-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3688 // CHECK35-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
3689 // CHECK35-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3690 // CHECK35-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3691 // CHECK35-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3692 // CHECK35-NEXT: store i32 0, ptr [[I]], align 4
3693 // CHECK35-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3694 // CHECK35-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
3695 // CHECK35-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
3696 // CHECK35: omp.precond.then:
3697 // CHECK35-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3698 // CHECK35-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3699 // CHECK35-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
3700 // CHECK35-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3701 // CHECK35-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3702 // CHECK35-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3703 // CHECK35-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
3704 // 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)
3705 // CHECK35-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3706 // CHECK35-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3707 // CHECK35-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
3708 // CHECK35-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3709 // CHECK35: cond.true:
3710 // CHECK35-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3711 // CHECK35-NEXT: br label [[COND_END:%.*]]
3712 // CHECK35: cond.false:
3713 // CHECK35-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3714 // CHECK35-NEXT: br label [[COND_END]]
3715 // CHECK35: cond.end:
3716 // CHECK35-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
3717 // CHECK35-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3718 // CHECK35-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3719 // CHECK35-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
3720 // CHECK35-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3721 // CHECK35: omp.inner.for.cond:
3722 // CHECK35-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
3723 // CHECK35-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP6]]
3724 // CHECK35-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
3725 // CHECK35-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3726 // CHECK35: omp.inner.for.body:
3727 // CHECK35-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
3728 // CHECK35-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
3729 // CHECK35-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3730 // CHECK35-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP6]]
3731 // CHECK35-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP6]]
3732 // CHECK35-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP17]]
3733 // CHECK35-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP6]]
3734 // CHECK35-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3735 // CHECK35: omp.body.continue:
3736 // CHECK35-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3737 // CHECK35: omp.inner.for.inc:
3738 // CHECK35-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
3739 // CHECK35-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
3740 // CHECK35-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
3741 // CHECK35-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
3742 // CHECK35: omp.inner.for.end:
3743 // CHECK35-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3744 // CHECK35: omp.loop.exit:
3745 // CHECK35-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3746 // CHECK35-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
3747 // CHECK35-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
3748 // CHECK35-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3749 // CHECK35-NEXT: [[TMP22:%.*]] = icmp ne i32 [[TMP21]], 0
3750 // CHECK35-NEXT: br i1 [[TMP22]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3751 // CHECK35: .omp.final.then:
3752 // CHECK35-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3753 // CHECK35-NEXT: [[SUB7:%.*]] = sub nsw i32 [[TMP23]], 0
3754 // CHECK35-NEXT: [[DIV8:%.*]] = sdiv i32 [[SUB7]], 1
3755 // CHECK35-NEXT: [[MUL9:%.*]] = mul nsw i32 [[DIV8]], 1
3756 // CHECK35-NEXT: [[ADD10:%.*]] = add nsw i32 0, [[MUL9]]
3757 // CHECK35-NEXT: store i32 [[ADD10]], ptr [[I3]], align 4
3758 // CHECK35-NEXT: br label [[DOTOMP_FINAL_DONE]]
3759 // CHECK35: .omp.final.done:
3760 // CHECK35-NEXT: br label [[OMP_PRECOND_END]]
3761 // CHECK35: omp.precond.end:
3762 // CHECK35-NEXT: ret void
3765 // CHECK35-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
3766 // CHECK35-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat {
3767 // CHECK35-NEXT: entry:
3768 // CHECK35-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3769 // CHECK35-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
3770 // CHECK35-NEXT: [[TE:%.*]] = alloca i32, align 4
3771 // CHECK35-NEXT: [[TH:%.*]] = alloca i32, align 4
3772 // CHECK35-NEXT: [[TE_CASTED:%.*]] = alloca i32, align 4
3773 // CHECK35-NEXT: [[TH_CASTED:%.*]] = alloca i32, align 4
3774 // CHECK35-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
3775 // CHECK35-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
3776 // CHECK35-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
3777 // CHECK35-NEXT: [[TMP:%.*]] = alloca i32, align 4
3778 // CHECK35-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3779 // CHECK35-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3780 // CHECK35-NEXT: store i32 0, ptr [[TE]], align 4
3781 // CHECK35-NEXT: store i32 128, ptr [[TH]], align 4
3782 // CHECK35-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
3783 // CHECK35-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
3784 // CHECK35-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE_CASTED]], align 4
3785 // CHECK35-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
3786 // CHECK35-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
3787 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_CASTED]], align 4
3788 // CHECK35-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3789 // CHECK35-NEXT: store i32 [[TMP1]], ptr [[TMP4]], align 4
3790 // CHECK35-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3791 // CHECK35-NEXT: store i32 [[TMP1]], ptr [[TMP5]], align 4
3792 // CHECK35-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
3793 // CHECK35-NEXT: store ptr null, ptr [[TMP6]], align 4
3794 // CHECK35-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3795 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
3796 // CHECK35-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3797 // CHECK35-NEXT: store i32 [[TMP3]], ptr [[TMP8]], align 4
3798 // CHECK35-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
3799 // CHECK35-NEXT: store ptr null, ptr [[TMP9]], align 4
3800 // CHECK35-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3801 // CHECK35-NEXT: store ptr [[A]], ptr [[TMP10]], align 4
3802 // CHECK35-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3803 // CHECK35-NEXT: store ptr [[A]], ptr [[TMP11]], align 4
3804 // CHECK35-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
3805 // CHECK35-NEXT: store ptr null, ptr [[TMP12]], align 4
3806 // CHECK35-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3807 // CHECK35-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3808 // CHECK35-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
3809 // CHECK35-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
3810 // CHECK35-NEXT: [[TMP17:%.*]] = icmp ult i32 [[TMP16]], 1
3811 // CHECK35-NEXT: [[TMP18:%.*]] = select i1 [[TMP17]], i32 [[TMP16]], i32 1
3812 // CHECK35-NEXT: [[TMP19:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
3813 // CHECK35-NEXT: [[TMP20:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP18]], 0
3814 // CHECK35-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3815 // CHECK35-NEXT: store i32 2, ptr [[TMP21]], align 4
3816 // CHECK35-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3817 // CHECK35-NEXT: store i32 3, ptr [[TMP22]], align 4
3818 // CHECK35-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3819 // CHECK35-NEXT: store ptr [[TMP13]], ptr [[TMP23]], align 4
3820 // CHECK35-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3821 // CHECK35-NEXT: store ptr [[TMP14]], ptr [[TMP24]], align 4
3822 // CHECK35-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3823 // CHECK35-NEXT: store ptr @.offload_sizes.1, ptr [[TMP25]], align 4
3824 // CHECK35-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3825 // CHECK35-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP26]], align 4
3826 // CHECK35-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3827 // CHECK35-NEXT: store ptr null, ptr [[TMP27]], align 4
3828 // CHECK35-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3829 // CHECK35-NEXT: store ptr null, ptr [[TMP28]], align 4
3830 // CHECK35-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3831 // CHECK35-NEXT: store i64 10, ptr [[TMP29]], align 8
3832 // CHECK35-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3833 // CHECK35-NEXT: store i64 0, ptr [[TMP30]], align 8
3834 // CHECK35-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3835 // CHECK35-NEXT: store [3 x i32] [[TMP19]], ptr [[TMP31]], align 4
3836 // CHECK35-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3837 // CHECK35-NEXT: store [3 x i32] [[TMP20]], ptr [[TMP32]], align 4
3838 // CHECK35-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3839 // CHECK35-NEXT: store i32 0, ptr [[TMP33]], align 4
3840 // 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]])
3841 // CHECK35-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
3842 // CHECK35-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3843 // CHECK35: omp_offload.failed:
3844 // CHECK35-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181(i32 [[TMP1]], i32 [[TMP3]], ptr [[A]]) #[[ATTR3]]
3845 // CHECK35-NEXT: br label [[OMP_OFFLOAD_CONT]]
3846 // CHECK35: omp_offload.cont:
3847 // CHECK35-NEXT: ret i32 0
3850 // CHECK35-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181
3851 // CHECK35-SAME: (i32 noundef [[TE:%.*]], i32 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
3852 // CHECK35-NEXT: entry:
3853 // CHECK35-NEXT: [[TE_ADDR:%.*]] = alloca i32, align 4
3854 // CHECK35-NEXT: [[TH_ADDR:%.*]] = alloca i32, align 4
3855 // CHECK35-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3856 // CHECK35-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
3857 // CHECK35-NEXT: store i32 [[TE]], ptr [[TE_ADDR]], align 4
3858 // CHECK35-NEXT: store i32 [[TH]], ptr [[TH_ADDR]], align 4
3859 // CHECK35-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3860 // CHECK35-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3861 // CHECK35-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
3862 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
3863 // CHECK35-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
3864 // 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]])
3865 // CHECK35-NEXT: ret void
3868 // CHECK35-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined
3869 // CHECK35-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
3870 // CHECK35-NEXT: entry:
3871 // CHECK35-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3872 // CHECK35-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3873 // CHECK35-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3874 // CHECK35-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3875 // CHECK35-NEXT: [[TMP:%.*]] = alloca i32, align 4
3876 // CHECK35-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3877 // CHECK35-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3878 // CHECK35-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3879 // CHECK35-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3880 // CHECK35-NEXT: [[I:%.*]] = alloca i32, align 4
3881 // CHECK35-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3882 // CHECK35-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3883 // CHECK35-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3884 // CHECK35-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3885 // CHECK35-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3886 // CHECK35-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
3887 // CHECK35-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3888 // CHECK35-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3889 // CHECK35-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3890 // CHECK35-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
3891 // 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)
3892 // CHECK35-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3893 // CHECK35-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
3894 // CHECK35-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3895 // CHECK35: cond.true:
3896 // CHECK35-NEXT: br label [[COND_END:%.*]]
3897 // CHECK35: cond.false:
3898 // CHECK35-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3899 // CHECK35-NEXT: br label [[COND_END]]
3900 // CHECK35: cond.end:
3901 // CHECK35-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
3902 // CHECK35-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3903 // CHECK35-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3904 // CHECK35-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
3905 // CHECK35-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3906 // CHECK35: omp.inner.for.cond:
3907 // CHECK35-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12:![0-9]+]]
3908 // CHECK35-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP12]]
3909 // CHECK35-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3910 // CHECK35-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3911 // CHECK35: omp.inner.for.body:
3912 // CHECK35-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12]]
3913 // CHECK35-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
3914 // CHECK35-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3915 // CHECK35-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP12]]
3916 // CHECK35-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP12]]
3917 // CHECK35-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i32 0, i32 [[TMP9]]
3918 // CHECK35-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP12]]
3919 // CHECK35-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3920 // CHECK35: omp.body.continue:
3921 // CHECK35-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3922 // CHECK35: omp.inner.for.inc:
3923 // CHECK35-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12]]
3924 // CHECK35-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
3925 // CHECK35-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12]]
3926 // CHECK35-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP13:![0-9]+]]
3927 // CHECK35: omp.inner.for.end:
3928 // CHECK35-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3929 // CHECK35: omp.loop.exit:
3930 // CHECK35-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
3931 // CHECK35-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3932 // CHECK35-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3933 // CHECK35-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3934 // CHECK35: .omp.final.then:
3935 // CHECK35-NEXT: store i32 10, ptr [[I]], align 4
3936 // CHECK35-NEXT: br label [[DOTOMP_FINAL_DONE]]
3937 // CHECK35: .omp.final.done:
3938 // CHECK35-NEXT: ret void
3941 // CHECK35-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
3942 // CHECK35-SAME: () #[[ATTR6:[0-9]+]] {
3943 // CHECK35-NEXT: entry:
3944 // CHECK35-NEXT: call void @__tgt_register_requires(i64 1)
3945 // CHECK35-NEXT: ret void
3948 // CHECK37-LABEL: define {{[^@]+}}@main
3949 // CHECK37-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
3950 // CHECK37-NEXT: entry:
3951 // CHECK37-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3952 // CHECK37-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3953 // CHECK37-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
3954 // CHECK37-NEXT: [[N:%.*]] = alloca i32, align 4
3955 // CHECK37-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
3956 // CHECK37-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
3957 // CHECK37-NEXT: [[ARGC_CASTED:%.*]] = alloca i64, align 8
3958 // CHECK37-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
3959 // CHECK37-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 8
3960 // CHECK37-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 8
3961 // CHECK37-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 8
3962 // CHECK37-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [4 x i64], align 8
3963 // CHECK37-NEXT: [[TMP:%.*]] = alloca i32, align 4
3964 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3965 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3966 // CHECK37-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3967 // CHECK37-NEXT: store i32 0, ptr [[RETVAL]], align 4
3968 // CHECK37-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3969 // CHECK37-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
3970 // CHECK37-NEXT: store i32 100, ptr [[N]], align 4
3971 // CHECK37-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
3972 // CHECK37-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
3973 // CHECK37-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
3974 // CHECK37-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
3975 // CHECK37-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
3976 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
3977 // CHECK37-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
3978 // CHECK37-NEXT: store i32 [[TMP3]], ptr [[ARGC_CASTED]], align 4
3979 // CHECK37-NEXT: [[TMP4:%.*]] = load i64, ptr [[ARGC_CASTED]], align 8
3980 // CHECK37-NEXT: [[TMP5:%.*]] = load i32, ptr [[N]], align 4
3981 // CHECK37-NEXT: store i32 [[TMP5]], ptr [[N_CASTED]], align 4
3982 // CHECK37-NEXT: [[TMP6:%.*]] = load i64, ptr [[N_CASTED]], align 8
3983 // CHECK37-NEXT: [[TMP7:%.*]] = mul nuw i64 [[TMP1]], 4
3984 // CHECK37-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 32, i1 false)
3985 // CHECK37-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3986 // CHECK37-NEXT: store i64 [[TMP4]], ptr [[TMP8]], align 8
3987 // CHECK37-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3988 // CHECK37-NEXT: store i64 [[TMP4]], ptr [[TMP9]], align 8
3989 // CHECK37-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
3990 // CHECK37-NEXT: store ptr null, ptr [[TMP10]], align 8
3991 // CHECK37-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3992 // CHECK37-NEXT: store i64 [[TMP6]], ptr [[TMP11]], align 8
3993 // CHECK37-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3994 // CHECK37-NEXT: store i64 [[TMP6]], ptr [[TMP12]], align 8
3995 // CHECK37-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
3996 // CHECK37-NEXT: store ptr null, ptr [[TMP13]], align 8
3997 // CHECK37-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3998 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[TMP14]], align 8
3999 // CHECK37-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
4000 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[TMP15]], align 8
4001 // CHECK37-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
4002 // CHECK37-NEXT: store ptr null, ptr [[TMP16]], align 8
4003 // CHECK37-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
4004 // CHECK37-NEXT: store ptr [[VLA]], ptr [[TMP17]], align 8
4005 // CHECK37-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
4006 // CHECK37-NEXT: store ptr [[VLA]], ptr [[TMP18]], align 8
4007 // CHECK37-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 3
4008 // CHECK37-NEXT: store i64 [[TMP7]], ptr [[TMP19]], align 8
4009 // CHECK37-NEXT: [[TMP20:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 3
4010 // CHECK37-NEXT: store ptr null, ptr [[TMP20]], align 8
4011 // CHECK37-NEXT: [[TMP21:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4012 // CHECK37-NEXT: [[TMP22:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4013 // CHECK37-NEXT: [[TMP23:%.*]] = getelementptr inbounds [4 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
4014 // CHECK37-NEXT: [[TMP24:%.*]] = load i32, ptr [[N]], align 4
4015 // CHECK37-NEXT: store i32 [[TMP24]], ptr [[DOTCAPTURE_EXPR_]], align 4
4016 // CHECK37-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4017 // CHECK37-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP25]], 0
4018 // CHECK37-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4019 // CHECK37-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
4020 // CHECK37-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4021 // CHECK37-NEXT: [[TMP26:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4022 // CHECK37-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP26]], 1
4023 // CHECK37-NEXT: [[TMP27:%.*]] = zext i32 [[ADD]] to i64
4024 // CHECK37-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4025 // CHECK37-NEXT: store i32 2, ptr [[TMP28]], align 4
4026 // CHECK37-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4027 // CHECK37-NEXT: store i32 4, ptr [[TMP29]], align 4
4028 // CHECK37-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4029 // CHECK37-NEXT: store ptr [[TMP21]], ptr [[TMP30]], align 8
4030 // CHECK37-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4031 // CHECK37-NEXT: store ptr [[TMP22]], ptr [[TMP31]], align 8
4032 // CHECK37-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4033 // CHECK37-NEXT: store ptr [[TMP23]], ptr [[TMP32]], align 8
4034 // CHECK37-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4035 // CHECK37-NEXT: store ptr @.offload_maptypes, ptr [[TMP33]], align 8
4036 // CHECK37-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4037 // CHECK37-NEXT: store ptr null, ptr [[TMP34]], align 8
4038 // CHECK37-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4039 // CHECK37-NEXT: store ptr null, ptr [[TMP35]], align 8
4040 // CHECK37-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4041 // CHECK37-NEXT: store i64 [[TMP27]], ptr [[TMP36]], align 8
4042 // CHECK37-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4043 // CHECK37-NEXT: store i64 0, ptr [[TMP37]], align 8
4044 // CHECK37-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4045 // CHECK37-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP38]], align 4
4046 // CHECK37-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4047 // CHECK37-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP39]], align 4
4048 // CHECK37-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4049 // CHECK37-NEXT: store i32 0, ptr [[TMP40]], align 4
4050 // 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]])
4051 // CHECK37-NEXT: [[TMP42:%.*]] = icmp ne i32 [[TMP41]], 0
4052 // CHECK37-NEXT: br i1 [[TMP42]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4053 // CHECK37: omp_offload.failed:
4054 // 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]+]]
4055 // CHECK37-NEXT: br label [[OMP_OFFLOAD_CONT]]
4056 // CHECK37: omp_offload.cont:
4057 // CHECK37-NEXT: [[TMP43:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4058 // CHECK37-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP43]])
4059 // CHECK37-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
4060 // CHECK37-NEXT: [[TMP44:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
4061 // CHECK37-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP44]])
4062 // CHECK37-NEXT: [[TMP45:%.*]] = load i32, ptr [[RETVAL]], align 4
4063 // CHECK37-NEXT: ret i32 [[TMP45]]
4066 // CHECK37-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192
4067 // CHECK37-SAME: (i64 noundef [[ARGC:%.*]], i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
4068 // CHECK37-NEXT: entry:
4069 // CHECK37-NEXT: [[ARGC_ADDR:%.*]] = alloca i64, align 8
4070 // CHECK37-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
4071 // CHECK37-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
4072 // CHECK37-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
4073 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
4074 // CHECK37-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
4075 // CHECK37-NEXT: store i64 [[ARGC]], ptr [[ARGC_ADDR]], align 8
4076 // CHECK37-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
4077 // CHECK37-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
4078 // CHECK37-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
4079 // CHECK37-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
4080 // CHECK37-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
4081 // CHECK37-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4082 // CHECK37-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP2]], 0
4083 // CHECK37-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
4084 // CHECK37-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
4085 // CHECK37-NEXT: [[TMP3:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
4086 // CHECK37-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP3]] to i1
4087 // CHECK37-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
4088 // CHECK37-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
4089 // CHECK37-NEXT: [[TMP4:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
4090 // 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]])
4091 // CHECK37-NEXT: ret void
4094 // CHECK37-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined
4095 // 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]] {
4096 // CHECK37-NEXT: entry:
4097 // CHECK37-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4098 // CHECK37-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4099 // CHECK37-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
4100 // CHECK37-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
4101 // CHECK37-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
4102 // CHECK37-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
4103 // CHECK37-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4104 // CHECK37-NEXT: [[TMP:%.*]] = alloca i32, align 4
4105 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
4106 // CHECK37-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
4107 // CHECK37-NEXT: [[I:%.*]] = alloca i32, align 4
4108 // CHECK37-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4109 // CHECK37-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4110 // CHECK37-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4111 // CHECK37-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4112 // CHECK37-NEXT: [[I4:%.*]] = alloca i32, align 4
4113 // CHECK37-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4114 // CHECK37-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4115 // CHECK37-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
4116 // CHECK37-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
4117 // CHECK37-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
4118 // CHECK37-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
4119 // CHECK37-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
4120 // CHECK37-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
4121 // CHECK37-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
4122 // CHECK37-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
4123 // CHECK37-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4124 // CHECK37-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4125 // CHECK37-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
4126 // CHECK37-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4127 // CHECK37-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
4128 // CHECK37-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
4129 // CHECK37-NEXT: store i32 0, ptr [[I]], align 4
4130 // CHECK37-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4131 // CHECK37-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
4132 // CHECK37-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
4133 // CHECK37: omp.precond.then:
4134 // CHECK37-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4135 // CHECK37-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4136 // CHECK37-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
4137 // CHECK37-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4138 // CHECK37-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4139 // CHECK37-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4140 // CHECK37-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
4141 // 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)
4142 // CHECK37-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4143 // CHECK37-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4144 // CHECK37-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
4145 // CHECK37-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4146 // CHECK37: cond.true:
4147 // CHECK37-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4148 // CHECK37-NEXT: br label [[COND_END:%.*]]
4149 // CHECK37: cond.false:
4150 // CHECK37-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4151 // CHECK37-NEXT: br label [[COND_END]]
4152 // CHECK37: cond.end:
4153 // CHECK37-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
4154 // CHECK37-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4155 // CHECK37-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4156 // CHECK37-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
4157 // CHECK37-NEXT: [[TMP14:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
4158 // CHECK37-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP14]] to i1
4159 // CHECK37-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
4160 // CHECK37: omp_if.then:
4161 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4162 // CHECK37: omp.inner.for.cond:
4163 // CHECK37-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5:![0-9]+]]
4164 // CHECK37-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP5]]
4165 // CHECK37-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
4166 // CHECK37-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4167 // CHECK37: omp.inner.for.body:
4168 // CHECK37-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
4169 // CHECK37-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
4170 // CHECK37-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4171 // CHECK37-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP5]]
4172 // CHECK37-NEXT: [[TMP18:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP5]]
4173 // CHECK37-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP18]] to i64
4174 // CHECK37-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
4175 // CHECK37-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP5]]
4176 // CHECK37-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4177 // CHECK37: omp.body.continue:
4178 // CHECK37-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4179 // CHECK37: omp.inner.for.inc:
4180 // CHECK37-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
4181 // CHECK37-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP19]], 1
4182 // CHECK37-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP5]]
4183 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP6:![0-9]+]]
4184 // CHECK37: omp.inner.for.end:
4185 // CHECK37-NEXT: br label [[OMP_IF_END:%.*]]
4186 // CHECK37: omp_if.else:
4187 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND8:%.*]]
4188 // CHECK37: omp.inner.for.cond8:
4189 // CHECK37-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4190 // CHECK37-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4191 // CHECK37-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP20]], [[TMP21]]
4192 // CHECK37-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY10:%.*]], label [[OMP_INNER_FOR_END18:%.*]]
4193 // CHECK37: omp.inner.for.body10:
4194 // CHECK37-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4195 // CHECK37-NEXT: [[MUL11:%.*]] = mul nsw i32 [[TMP22]], 1
4196 // CHECK37-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
4197 // CHECK37-NEXT: store i32 [[ADD12]], ptr [[I4]], align 4
4198 // CHECK37-NEXT: [[TMP23:%.*]] = load i32, ptr [[I4]], align 4
4199 // CHECK37-NEXT: [[IDXPROM13:%.*]] = sext i32 [[TMP23]] to i64
4200 // CHECK37-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM13]]
4201 // CHECK37-NEXT: store i32 0, ptr [[ARRAYIDX14]], align 4
4202 // CHECK37-NEXT: br label [[OMP_BODY_CONTINUE15:%.*]]
4203 // CHECK37: omp.body.continue15:
4204 // CHECK37-NEXT: br label [[OMP_INNER_FOR_INC16:%.*]]
4205 // CHECK37: omp.inner.for.inc16:
4206 // CHECK37-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4207 // CHECK37-NEXT: [[ADD17:%.*]] = add nsw i32 [[TMP24]], 1
4208 // CHECK37-NEXT: store i32 [[ADD17]], ptr [[DOTOMP_IV]], align 4
4209 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND8]], !llvm.loop [[LOOP9:![0-9]+]]
4210 // CHECK37: omp.inner.for.end18:
4211 // CHECK37-NEXT: br label [[OMP_IF_END]]
4212 // CHECK37: omp_if.end:
4213 // CHECK37-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4214 // CHECK37: omp.loop.exit:
4215 // CHECK37-NEXT: [[TMP25:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4216 // CHECK37-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP25]], align 4
4217 // CHECK37-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP26]])
4218 // CHECK37-NEXT: [[TMP27:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4219 // CHECK37-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
4220 // CHECK37-NEXT: br i1 [[TMP28]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4221 // CHECK37: .omp.final.then:
4222 // CHECK37-NEXT: [[TMP29:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4223 // CHECK37-NEXT: [[SUB19:%.*]] = sub nsw i32 [[TMP29]], 0
4224 // CHECK37-NEXT: [[DIV20:%.*]] = sdiv i32 [[SUB19]], 1
4225 // CHECK37-NEXT: [[MUL21:%.*]] = mul nsw i32 [[DIV20]], 1
4226 // CHECK37-NEXT: [[ADD22:%.*]] = add nsw i32 0, [[MUL21]]
4227 // CHECK37-NEXT: store i32 [[ADD22]], ptr [[I4]], align 4
4228 // CHECK37-NEXT: br label [[DOTOMP_FINAL_DONE]]
4229 // CHECK37: .omp.final.done:
4230 // CHECK37-NEXT: br label [[OMP_PRECOND_END]]
4231 // CHECK37: omp.precond.end:
4232 // CHECK37-NEXT: ret void
4235 // CHECK37-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
4236 // CHECK37-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat {
4237 // CHECK37-NEXT: entry:
4238 // CHECK37-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4239 // CHECK37-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
4240 // CHECK37-NEXT: [[TE:%.*]] = alloca i32, align 4
4241 // CHECK37-NEXT: [[TH:%.*]] = alloca i32, align 4
4242 // CHECK37-NEXT: [[TE_CASTED:%.*]] = alloca i64, align 8
4243 // CHECK37-NEXT: [[TH_CASTED:%.*]] = alloca i64, align 8
4244 // CHECK37-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
4245 // CHECK37-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
4246 // CHECK37-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
4247 // CHECK37-NEXT: [[TMP:%.*]] = alloca i32, align 4
4248 // CHECK37-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4249 // CHECK37-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4250 // CHECK37-NEXT: store i32 0, ptr [[TE]], align 4
4251 // CHECK37-NEXT: store i32 128, ptr [[TH]], align 4
4252 // CHECK37-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
4253 // CHECK37-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
4254 // CHECK37-NEXT: [[TMP1:%.*]] = load i64, ptr [[TE_CASTED]], align 8
4255 // CHECK37-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
4256 // CHECK37-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
4257 // CHECK37-NEXT: [[TMP3:%.*]] = load i64, ptr [[TH_CASTED]], align 8
4258 // CHECK37-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4259 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[TMP4]], align 8
4260 // CHECK37-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4261 // CHECK37-NEXT: store i64 [[TMP1]], ptr [[TMP5]], align 8
4262 // CHECK37-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
4263 // CHECK37-NEXT: store ptr null, ptr [[TMP6]], align 8
4264 // CHECK37-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
4265 // CHECK37-NEXT: store i64 [[TMP3]], ptr [[TMP7]], align 8
4266 // CHECK37-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
4267 // CHECK37-NEXT: store i64 [[TMP3]], ptr [[TMP8]], align 8
4268 // CHECK37-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
4269 // CHECK37-NEXT: store ptr null, ptr [[TMP9]], align 8
4270 // CHECK37-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
4271 // CHECK37-NEXT: store ptr [[A]], ptr [[TMP10]], align 8
4272 // CHECK37-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
4273 // CHECK37-NEXT: store ptr [[A]], ptr [[TMP11]], align 8
4274 // CHECK37-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
4275 // CHECK37-NEXT: store ptr null, ptr [[TMP12]], align 8
4276 // CHECK37-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4277 // CHECK37-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4278 // CHECK37-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
4279 // CHECK37-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
4280 // CHECK37-NEXT: [[TMP17:%.*]] = icmp ult i32 [[TMP16]], 1
4281 // CHECK37-NEXT: [[TMP18:%.*]] = select i1 [[TMP17]], i32 [[TMP16]], i32 1
4282 // CHECK37-NEXT: [[TMP19:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
4283 // CHECK37-NEXT: [[TMP20:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP18]], 0
4284 // CHECK37-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4285 // CHECK37-NEXT: store i32 2, ptr [[TMP21]], align 4
4286 // CHECK37-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4287 // CHECK37-NEXT: store i32 3, ptr [[TMP22]], align 4
4288 // CHECK37-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4289 // CHECK37-NEXT: store ptr [[TMP13]], ptr [[TMP23]], align 8
4290 // CHECK37-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4291 // CHECK37-NEXT: store ptr [[TMP14]], ptr [[TMP24]], align 8
4292 // CHECK37-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4293 // CHECK37-NEXT: store ptr @.offload_sizes.1, ptr [[TMP25]], align 8
4294 // CHECK37-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4295 // CHECK37-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP26]], align 8
4296 // CHECK37-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4297 // CHECK37-NEXT: store ptr null, ptr [[TMP27]], align 8
4298 // CHECK37-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4299 // CHECK37-NEXT: store ptr null, ptr [[TMP28]], align 8
4300 // CHECK37-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4301 // CHECK37-NEXT: store i64 10, ptr [[TMP29]], align 8
4302 // CHECK37-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4303 // CHECK37-NEXT: store i64 0, ptr [[TMP30]], align 8
4304 // CHECK37-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4305 // CHECK37-NEXT: store [3 x i32] [[TMP19]], ptr [[TMP31]], align 4
4306 // CHECK37-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4307 // CHECK37-NEXT: store [3 x i32] [[TMP20]], ptr [[TMP32]], align 4
4308 // CHECK37-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4309 // CHECK37-NEXT: store i32 0, ptr [[TMP33]], align 4
4310 // 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]])
4311 // CHECK37-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
4312 // CHECK37-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4313 // CHECK37: omp_offload.failed:
4314 // CHECK37-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181(i64 [[TMP1]], i64 [[TMP3]], ptr [[A]]) #[[ATTR3]]
4315 // CHECK37-NEXT: br label [[OMP_OFFLOAD_CONT]]
4316 // CHECK37: omp_offload.cont:
4317 // CHECK37-NEXT: ret i32 0
4320 // CHECK37-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181
4321 // CHECK37-SAME: (i64 noundef [[TE:%.*]], i64 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
4322 // CHECK37-NEXT: entry:
4323 // CHECK37-NEXT: [[TE_ADDR:%.*]] = alloca i64, align 8
4324 // CHECK37-NEXT: [[TH_ADDR:%.*]] = alloca i64, align 8
4325 // CHECK37-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
4326 // CHECK37-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4327 // CHECK37-NEXT: store i64 [[TE]], ptr [[TE_ADDR]], align 8
4328 // CHECK37-NEXT: store i64 [[TH]], ptr [[TH_ADDR]], align 8
4329 // CHECK37-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
4330 // CHECK37-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
4331 // CHECK37-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
4332 // CHECK37-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
4333 // CHECK37-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
4334 // 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]])
4335 // CHECK37-NEXT: ret void
4338 // CHECK37-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined
4339 // CHECK37-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
4340 // CHECK37-NEXT: entry:
4341 // CHECK37-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4342 // CHECK37-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4343 // CHECK37-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
4344 // CHECK37-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4345 // CHECK37-NEXT: [[TMP:%.*]] = alloca i32, align 4
4346 // CHECK37-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4347 // CHECK37-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4348 // CHECK37-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4349 // CHECK37-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4350 // CHECK37-NEXT: [[I:%.*]] = alloca i32, align 4
4351 // CHECK37-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4352 // CHECK37-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4353 // CHECK37-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
4354 // CHECK37-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
4355 // CHECK37-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4356 // CHECK37-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
4357 // CHECK37-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4358 // CHECK37-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4359 // CHECK37-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4360 // CHECK37-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
4361 // 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)
4362 // CHECK37-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4363 // CHECK37-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
4364 // CHECK37-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4365 // CHECK37: cond.true:
4366 // CHECK37-NEXT: br label [[COND_END:%.*]]
4367 // CHECK37: cond.false:
4368 // CHECK37-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4369 // CHECK37-NEXT: br label [[COND_END]]
4370 // CHECK37: cond.end:
4371 // CHECK37-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
4372 // CHECK37-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4373 // CHECK37-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4374 // CHECK37-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
4375 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4376 // CHECK37: omp.inner.for.cond:
4377 // CHECK37-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP13:![0-9]+]]
4378 // CHECK37-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP13]]
4379 // CHECK37-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
4380 // CHECK37-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4381 // CHECK37: omp.inner.for.body:
4382 // CHECK37-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP13]]
4383 // CHECK37-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
4384 // CHECK37-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4385 // CHECK37-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP13]]
4386 // CHECK37-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP13]]
4387 // CHECK37-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
4388 // CHECK37-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i64 0, i64 [[IDXPROM]]
4389 // CHECK37-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP13]]
4390 // CHECK37-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4391 // CHECK37: omp.body.continue:
4392 // CHECK37-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4393 // CHECK37: omp.inner.for.inc:
4394 // CHECK37-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP13]]
4395 // CHECK37-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
4396 // CHECK37-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP13]]
4397 // CHECK37-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP14:![0-9]+]]
4398 // CHECK37: omp.inner.for.end:
4399 // CHECK37-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4400 // CHECK37: omp.loop.exit:
4401 // CHECK37-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
4402 // CHECK37-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4403 // CHECK37-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4404 // CHECK37-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4405 // CHECK37: .omp.final.then:
4406 // CHECK37-NEXT: store i32 10, ptr [[I]], align 4
4407 // CHECK37-NEXT: br label [[DOTOMP_FINAL_DONE]]
4408 // CHECK37: .omp.final.done:
4409 // CHECK37-NEXT: ret void
4412 // CHECK37-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
4413 // CHECK37-SAME: () #[[ATTR6:[0-9]+]] {
4414 // CHECK37-NEXT: entry:
4415 // CHECK37-NEXT: call void @__tgt_register_requires(i64 1)
4416 // CHECK37-NEXT: ret void
4419 // CHECK39-LABEL: define {{[^@]+}}@main
4420 // CHECK39-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
4421 // CHECK39-NEXT: entry:
4422 // CHECK39-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
4423 // CHECK39-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4424 // CHECK39-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
4425 // CHECK39-NEXT: [[N:%.*]] = alloca i32, align 4
4426 // CHECK39-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
4427 // CHECK39-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
4428 // CHECK39-NEXT: [[ARGC_CASTED:%.*]] = alloca i32, align 4
4429 // CHECK39-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
4430 // CHECK39-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 4
4431 // CHECK39-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 4
4432 // CHECK39-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 4
4433 // CHECK39-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [4 x i64], align 4
4434 // CHECK39-NEXT: [[TMP:%.*]] = alloca i32, align 4
4435 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
4436 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
4437 // CHECK39-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4438 // CHECK39-NEXT: store i32 0, ptr [[RETVAL]], align 4
4439 // CHECK39-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4440 // CHECK39-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
4441 // CHECK39-NEXT: store i32 100, ptr [[N]], align 4
4442 // CHECK39-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
4443 // CHECK39-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
4444 // CHECK39-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
4445 // CHECK39-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
4446 // CHECK39-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
4447 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4448 // CHECK39-NEXT: store i32 [[TMP2]], ptr [[ARGC_CASTED]], align 4
4449 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARGC_CASTED]], align 4
4450 // CHECK39-NEXT: [[TMP4:%.*]] = load i32, ptr [[N]], align 4
4451 // CHECK39-NEXT: store i32 [[TMP4]], ptr [[N_CASTED]], align 4
4452 // CHECK39-NEXT: [[TMP5:%.*]] = load i32, ptr [[N_CASTED]], align 4
4453 // CHECK39-NEXT: [[TMP6:%.*]] = mul nuw i32 [[TMP0]], 4
4454 // CHECK39-NEXT: [[TMP7:%.*]] = sext i32 [[TMP6]] to i64
4455 // CHECK39-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 32, i1 false)
4456 // CHECK39-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4457 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[TMP8]], align 4
4458 // CHECK39-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4459 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[TMP9]], align 4
4460 // CHECK39-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
4461 // CHECK39-NEXT: store ptr null, ptr [[TMP10]], align 4
4462 // CHECK39-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
4463 // CHECK39-NEXT: store i32 [[TMP5]], ptr [[TMP11]], align 4
4464 // CHECK39-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
4465 // CHECK39-NEXT: store i32 [[TMP5]], ptr [[TMP12]], align 4
4466 // CHECK39-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
4467 // CHECK39-NEXT: store ptr null, ptr [[TMP13]], align 4
4468 // CHECK39-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
4469 // CHECK39-NEXT: store i32 [[TMP0]], ptr [[TMP14]], align 4
4470 // CHECK39-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
4471 // CHECK39-NEXT: store i32 [[TMP0]], ptr [[TMP15]], align 4
4472 // CHECK39-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
4473 // CHECK39-NEXT: store ptr null, ptr [[TMP16]], align 4
4474 // CHECK39-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
4475 // CHECK39-NEXT: store ptr [[VLA]], ptr [[TMP17]], align 4
4476 // CHECK39-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
4477 // CHECK39-NEXT: store ptr [[VLA]], ptr [[TMP18]], align 4
4478 // CHECK39-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 3
4479 // CHECK39-NEXT: store i64 [[TMP7]], ptr [[TMP19]], align 4
4480 // CHECK39-NEXT: [[TMP20:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 3
4481 // CHECK39-NEXT: store ptr null, ptr [[TMP20]], align 4
4482 // CHECK39-NEXT: [[TMP21:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4483 // CHECK39-NEXT: [[TMP22:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4484 // CHECK39-NEXT: [[TMP23:%.*]] = getelementptr inbounds [4 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
4485 // CHECK39-NEXT: [[TMP24:%.*]] = load i32, ptr [[N]], align 4
4486 // CHECK39-NEXT: store i32 [[TMP24]], ptr [[DOTCAPTURE_EXPR_]], align 4
4487 // CHECK39-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4488 // CHECK39-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP25]], 0
4489 // CHECK39-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4490 // CHECK39-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
4491 // CHECK39-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4492 // CHECK39-NEXT: [[TMP26:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4493 // CHECK39-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP26]], 1
4494 // CHECK39-NEXT: [[TMP27:%.*]] = zext i32 [[ADD]] to i64
4495 // CHECK39-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4496 // CHECK39-NEXT: store i32 2, ptr [[TMP28]], align 4
4497 // CHECK39-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4498 // CHECK39-NEXT: store i32 4, ptr [[TMP29]], align 4
4499 // CHECK39-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4500 // CHECK39-NEXT: store ptr [[TMP21]], ptr [[TMP30]], align 4
4501 // CHECK39-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4502 // CHECK39-NEXT: store ptr [[TMP22]], ptr [[TMP31]], align 4
4503 // CHECK39-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4504 // CHECK39-NEXT: store ptr [[TMP23]], ptr [[TMP32]], align 4
4505 // CHECK39-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4506 // CHECK39-NEXT: store ptr @.offload_maptypes, ptr [[TMP33]], align 4
4507 // CHECK39-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4508 // CHECK39-NEXT: store ptr null, ptr [[TMP34]], align 4
4509 // CHECK39-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4510 // CHECK39-NEXT: store ptr null, ptr [[TMP35]], align 4
4511 // CHECK39-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4512 // CHECK39-NEXT: store i64 [[TMP27]], ptr [[TMP36]], align 8
4513 // CHECK39-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4514 // CHECK39-NEXT: store i64 0, ptr [[TMP37]], align 8
4515 // CHECK39-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4516 // CHECK39-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP38]], align 4
4517 // CHECK39-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4518 // CHECK39-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP39]], align 4
4519 // CHECK39-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4520 // CHECK39-NEXT: store i32 0, ptr [[TMP40]], align 4
4521 // 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]])
4522 // CHECK39-NEXT: [[TMP42:%.*]] = icmp ne i32 [[TMP41]], 0
4523 // CHECK39-NEXT: br i1 [[TMP42]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4524 // CHECK39: omp_offload.failed:
4525 // 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]+]]
4526 // CHECK39-NEXT: br label [[OMP_OFFLOAD_CONT]]
4527 // CHECK39: omp_offload.cont:
4528 // CHECK39-NEXT: [[TMP43:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4529 // CHECK39-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP43]])
4530 // CHECK39-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
4531 // CHECK39-NEXT: [[TMP44:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
4532 // CHECK39-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP44]])
4533 // CHECK39-NEXT: [[TMP45:%.*]] = load i32, ptr [[RETVAL]], align 4
4534 // CHECK39-NEXT: ret i32 [[TMP45]]
4537 // CHECK39-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192
4538 // CHECK39-SAME: (i32 noundef [[ARGC:%.*]], i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
4539 // CHECK39-NEXT: entry:
4540 // CHECK39-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4541 // CHECK39-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
4542 // CHECK39-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
4543 // CHECK39-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
4544 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
4545 // CHECK39-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
4546 // CHECK39-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4547 // CHECK39-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
4548 // CHECK39-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
4549 // CHECK39-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
4550 // CHECK39-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
4551 // CHECK39-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
4552 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4553 // CHECK39-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP2]], 0
4554 // CHECK39-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
4555 // CHECK39-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
4556 // CHECK39-NEXT: [[TMP3:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
4557 // CHECK39-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP3]] to i1
4558 // CHECK39-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
4559 // CHECK39-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
4560 // CHECK39-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR__CASTED]], align 4
4561 // 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]])
4562 // CHECK39-NEXT: ret void
4565 // CHECK39-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l192.omp_outlined
4566 // 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]] {
4567 // CHECK39-NEXT: entry:
4568 // CHECK39-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
4569 // CHECK39-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
4570 // CHECK39-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
4571 // CHECK39-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
4572 // CHECK39-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
4573 // CHECK39-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
4574 // CHECK39-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4575 // CHECK39-NEXT: [[TMP:%.*]] = alloca i32, align 4
4576 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
4577 // CHECK39-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
4578 // CHECK39-NEXT: [[I:%.*]] = alloca i32, align 4
4579 // CHECK39-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4580 // CHECK39-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4581 // CHECK39-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4582 // CHECK39-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4583 // CHECK39-NEXT: [[I4:%.*]] = alloca i32, align 4
4584 // CHECK39-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
4585 // CHECK39-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
4586 // CHECK39-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
4587 // CHECK39-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
4588 // CHECK39-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
4589 // CHECK39-NEXT: store i32 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 4
4590 // CHECK39-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
4591 // CHECK39-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
4592 // CHECK39-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
4593 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
4594 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4595 // CHECK39-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4596 // CHECK39-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
4597 // CHECK39-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4598 // CHECK39-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
4599 // CHECK39-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
4600 // CHECK39-NEXT: store i32 0, ptr [[I]], align 4
4601 // CHECK39-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4602 // CHECK39-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
4603 // CHECK39-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
4604 // CHECK39: omp.precond.then:
4605 // CHECK39-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4606 // CHECK39-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4607 // CHECK39-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
4608 // CHECK39-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4609 // CHECK39-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4610 // CHECK39-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
4611 // CHECK39-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
4612 // 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)
4613 // CHECK39-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4614 // CHECK39-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4615 // CHECK39-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
4616 // CHECK39-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4617 // CHECK39: cond.true:
4618 // CHECK39-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
4619 // CHECK39-NEXT: br label [[COND_END:%.*]]
4620 // CHECK39: cond.false:
4621 // CHECK39-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4622 // CHECK39-NEXT: br label [[COND_END]]
4623 // CHECK39: cond.end:
4624 // CHECK39-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
4625 // CHECK39-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4626 // CHECK39-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4627 // CHECK39-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
4628 // CHECK39-NEXT: [[TMP14:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
4629 // CHECK39-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP14]] to i1
4630 // CHECK39-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
4631 // CHECK39: omp_if.then:
4632 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4633 // CHECK39: omp.inner.for.cond:
4634 // CHECK39-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
4635 // CHECK39-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP6]]
4636 // CHECK39-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
4637 // CHECK39-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4638 // CHECK39: omp.inner.for.body:
4639 // CHECK39-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4640 // CHECK39-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
4641 // CHECK39-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4642 // CHECK39-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP6]]
4643 // CHECK39-NEXT: [[TMP18:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP6]]
4644 // CHECK39-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP18]]
4645 // CHECK39-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP6]]
4646 // CHECK39-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4647 // CHECK39: omp.body.continue:
4648 // CHECK39-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4649 // CHECK39: omp.inner.for.inc:
4650 // CHECK39-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4651 // CHECK39-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP19]], 1
4652 // CHECK39-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4653 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
4654 // CHECK39: omp.inner.for.end:
4655 // CHECK39-NEXT: br label [[OMP_IF_END:%.*]]
4656 // CHECK39: omp_if.else:
4657 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND8:%.*]]
4658 // CHECK39: omp.inner.for.cond8:
4659 // CHECK39-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4660 // CHECK39-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4661 // CHECK39-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP20]], [[TMP21]]
4662 // CHECK39-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY10:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
4663 // CHECK39: omp.inner.for.body10:
4664 // CHECK39-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4665 // CHECK39-NEXT: [[MUL11:%.*]] = mul nsw i32 [[TMP22]], 1
4666 // CHECK39-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
4667 // CHECK39-NEXT: store i32 [[ADD12]], ptr [[I4]], align 4
4668 // CHECK39-NEXT: [[TMP23:%.*]] = load i32, ptr [[I4]], align 4
4669 // CHECK39-NEXT: [[ARRAYIDX13:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP23]]
4670 // CHECK39-NEXT: store i32 0, ptr [[ARRAYIDX13]], align 4
4671 // CHECK39-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
4672 // CHECK39: omp.body.continue14:
4673 // CHECK39-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
4674 // CHECK39: omp.inner.for.inc15:
4675 // CHECK39-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
4676 // CHECK39-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP24]], 1
4677 // CHECK39-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
4678 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND8]], !llvm.loop [[LOOP10:![0-9]+]]
4679 // CHECK39: omp.inner.for.end17:
4680 // CHECK39-NEXT: br label [[OMP_IF_END]]
4681 // CHECK39: omp_if.end:
4682 // CHECK39-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4683 // CHECK39: omp.loop.exit:
4684 // CHECK39-NEXT: [[TMP25:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
4685 // CHECK39-NEXT: [[TMP26:%.*]] = load i32, ptr [[TMP25]], align 4
4686 // CHECK39-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP26]])
4687 // CHECK39-NEXT: [[TMP27:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4688 // CHECK39-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
4689 // CHECK39-NEXT: br i1 [[TMP28]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4690 // CHECK39: .omp.final.then:
4691 // CHECK39-NEXT: [[TMP29:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4692 // CHECK39-NEXT: [[SUB18:%.*]] = sub nsw i32 [[TMP29]], 0
4693 // CHECK39-NEXT: [[DIV19:%.*]] = sdiv i32 [[SUB18]], 1
4694 // CHECK39-NEXT: [[MUL20:%.*]] = mul nsw i32 [[DIV19]], 1
4695 // CHECK39-NEXT: [[ADD21:%.*]] = add nsw i32 0, [[MUL20]]
4696 // CHECK39-NEXT: store i32 [[ADD21]], ptr [[I4]], align 4
4697 // CHECK39-NEXT: br label [[DOTOMP_FINAL_DONE]]
4698 // CHECK39: .omp.final.done:
4699 // CHECK39-NEXT: br label [[OMP_PRECOND_END]]
4700 // CHECK39: omp.precond.end:
4701 // CHECK39-NEXT: ret void
4704 // CHECK39-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
4705 // CHECK39-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat {
4706 // CHECK39-NEXT: entry:
4707 // CHECK39-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4708 // CHECK39-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
4709 // CHECK39-NEXT: [[TE:%.*]] = alloca i32, align 4
4710 // CHECK39-NEXT: [[TH:%.*]] = alloca i32, align 4
4711 // CHECK39-NEXT: [[TE_CASTED:%.*]] = alloca i32, align 4
4712 // CHECK39-NEXT: [[TH_CASTED:%.*]] = alloca i32, align 4
4713 // CHECK39-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
4714 // CHECK39-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
4715 // CHECK39-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
4716 // CHECK39-NEXT: [[TMP:%.*]] = alloca i32, align 4
4717 // CHECK39-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4718 // CHECK39-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4719 // CHECK39-NEXT: store i32 0, ptr [[TE]], align 4
4720 // CHECK39-NEXT: store i32 128, ptr [[TH]], align 4
4721 // CHECK39-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
4722 // CHECK39-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
4723 // CHECK39-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE_CASTED]], align 4
4724 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
4725 // CHECK39-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
4726 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_CASTED]], align 4
4727 // CHECK39-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4728 // CHECK39-NEXT: store i32 [[TMP1]], ptr [[TMP4]], align 4
4729 // CHECK39-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4730 // CHECK39-NEXT: store i32 [[TMP1]], ptr [[TMP5]], align 4
4731 // CHECK39-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
4732 // CHECK39-NEXT: store ptr null, ptr [[TMP6]], align 4
4733 // CHECK39-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
4734 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
4735 // CHECK39-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
4736 // CHECK39-NEXT: store i32 [[TMP3]], ptr [[TMP8]], align 4
4737 // CHECK39-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
4738 // CHECK39-NEXT: store ptr null, ptr [[TMP9]], align 4
4739 // CHECK39-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
4740 // CHECK39-NEXT: store ptr [[A]], ptr [[TMP10]], align 4
4741 // CHECK39-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
4742 // CHECK39-NEXT: store ptr [[A]], ptr [[TMP11]], align 4
4743 // CHECK39-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
4744 // CHECK39-NEXT: store ptr null, ptr [[TMP12]], align 4
4745 // CHECK39-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4746 // CHECK39-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4747 // CHECK39-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
4748 // CHECK39-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
4749 // CHECK39-NEXT: [[TMP17:%.*]] = icmp ult i32 [[TMP16]], 1
4750 // CHECK39-NEXT: [[TMP18:%.*]] = select i1 [[TMP17]], i32 [[TMP16]], i32 1
4751 // CHECK39-NEXT: [[TMP19:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
4752 // CHECK39-NEXT: [[TMP20:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP18]], 0
4753 // CHECK39-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4754 // CHECK39-NEXT: store i32 2, ptr [[TMP21]], align 4
4755 // CHECK39-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4756 // CHECK39-NEXT: store i32 3, ptr [[TMP22]], align 4
4757 // CHECK39-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4758 // CHECK39-NEXT: store ptr [[TMP13]], ptr [[TMP23]], align 4
4759 // CHECK39-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4760 // CHECK39-NEXT: store ptr [[TMP14]], ptr [[TMP24]], align 4
4761 // CHECK39-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4762 // CHECK39-NEXT: store ptr @.offload_sizes.1, ptr [[TMP25]], align 4
4763 // CHECK39-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4764 // CHECK39-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP26]], align 4
4765 // CHECK39-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4766 // CHECK39-NEXT: store ptr null, ptr [[TMP27]], align 4
4767 // CHECK39-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4768 // CHECK39-NEXT: store ptr null, ptr [[TMP28]], align 4
4769 // CHECK39-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4770 // CHECK39-NEXT: store i64 10, ptr [[TMP29]], align 8
4771 // CHECK39-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4772 // CHECK39-NEXT: store i64 0, ptr [[TMP30]], align 8
4773 // CHECK39-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4774 // CHECK39-NEXT: store [3 x i32] [[TMP19]], ptr [[TMP31]], align 4
4775 // CHECK39-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4776 // CHECK39-NEXT: store [3 x i32] [[TMP20]], ptr [[TMP32]], align 4
4777 // CHECK39-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4778 // CHECK39-NEXT: store i32 0, ptr [[TMP33]], align 4
4779 // 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]])
4780 // CHECK39-NEXT: [[TMP35:%.*]] = icmp ne i32 [[TMP34]], 0
4781 // CHECK39-NEXT: br i1 [[TMP35]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4782 // CHECK39: omp_offload.failed:
4783 // CHECK39-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181(i32 [[TMP1]], i32 [[TMP3]], ptr [[A]]) #[[ATTR3]]
4784 // CHECK39-NEXT: br label [[OMP_OFFLOAD_CONT]]
4785 // CHECK39: omp_offload.cont:
4786 // CHECK39-NEXT: ret i32 0
4789 // CHECK39-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181
4790 // CHECK39-SAME: (i32 noundef [[TE:%.*]], i32 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
4791 // CHECK39-NEXT: entry:
4792 // CHECK39-NEXT: [[TE_ADDR:%.*]] = alloca i32, align 4
4793 // CHECK39-NEXT: [[TH_ADDR:%.*]] = alloca i32, align 4
4794 // CHECK39-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
4795 // CHECK39-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4796 // CHECK39-NEXT: store i32 [[TE]], ptr [[TE_ADDR]], align 4
4797 // CHECK39-NEXT: store i32 [[TH]], ptr [[TH_ADDR]], align 4
4798 // CHECK39-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
4799 // CHECK39-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
4800 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
4801 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
4802 // CHECK39-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB2]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
4803 // 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]])
4804 // CHECK39-NEXT: ret void
4807 // CHECK39-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l181.omp_outlined
4808 // CHECK39-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
4809 // CHECK39-NEXT: entry:
4810 // CHECK39-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
4811 // CHECK39-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
4812 // CHECK39-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
4813 // CHECK39-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4814 // CHECK39-NEXT: [[TMP:%.*]] = alloca i32, align 4
4815 // CHECK39-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4816 // CHECK39-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4817 // CHECK39-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4818 // CHECK39-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4819 // CHECK39-NEXT: [[I:%.*]] = alloca i32, align 4
4820 // CHECK39-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
4821 // CHECK39-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
4822 // CHECK39-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
4823 // CHECK39-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
4824 // CHECK39-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4825 // CHECK39-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
4826 // CHECK39-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4827 // CHECK39-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4828 // CHECK39-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
4829 // CHECK39-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
4830 // 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)
4831 // CHECK39-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4832 // CHECK39-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
4833 // CHECK39-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4834 // CHECK39: cond.true:
4835 // CHECK39-NEXT: br label [[COND_END:%.*]]
4836 // CHECK39: cond.false:
4837 // CHECK39-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4838 // CHECK39-NEXT: br label [[COND_END]]
4839 // CHECK39: cond.end:
4840 // CHECK39-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
4841 // CHECK39-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4842 // CHECK39-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4843 // CHECK39-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
4844 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4845 // CHECK39: omp.inner.for.cond:
4846 // CHECK39-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14:![0-9]+]]
4847 // CHECK39-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP14]]
4848 // CHECK39-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
4849 // CHECK39-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4850 // CHECK39: omp.inner.for.body:
4851 // CHECK39-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14]]
4852 // CHECK39-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
4853 // CHECK39-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4854 // CHECK39-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP14]]
4855 // CHECK39-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP14]]
4856 // CHECK39-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i32 0, i32 [[TMP9]]
4857 // CHECK39-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP14]]
4858 // CHECK39-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4859 // CHECK39: omp.body.continue:
4860 // CHECK39-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4861 // CHECK39: omp.inner.for.inc:
4862 // CHECK39-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14]]
4863 // CHECK39-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
4864 // CHECK39-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14]]
4865 // CHECK39-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]]
4866 // CHECK39: omp.inner.for.end:
4867 // CHECK39-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4868 // CHECK39: omp.loop.exit:
4869 // CHECK39-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
4870 // CHECK39-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4871 // CHECK39-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4872 // CHECK39-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4873 // CHECK39: .omp.final.then:
4874 // CHECK39-NEXT: store i32 10, ptr [[I]], align 4
4875 // CHECK39-NEXT: br label [[DOTOMP_FINAL_DONE]]
4876 // CHECK39: .omp.final.done:
4877 // CHECK39-NEXT: ret void
4880 // CHECK39-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
4881 // CHECK39-SAME: () #[[ATTR6:[0-9]+]] {
4882 // CHECK39-NEXT: entry:
4883 // CHECK39-NEXT: call void @__tgt_register_requires(i64 1)
4884 // CHECK39-NEXT: ret void
4887 // CHECK41-LABEL: define {{[^@]+}}@main
4888 // CHECK41-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
4889 // CHECK41-NEXT: entry:
4890 // CHECK41-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
4891 // CHECK41-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4892 // CHECK41-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
4893 // CHECK41-NEXT: [[N:%.*]] = alloca i32, align 4
4894 // CHECK41-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
4895 // CHECK41-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
4896 // CHECK41-NEXT: [[TMP:%.*]] = alloca i32, align 4
4897 // CHECK41-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
4898 // CHECK41-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
4899 // CHECK41-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4900 // CHECK41-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4901 // CHECK41-NEXT: [[I:%.*]] = alloca i32, align 4
4902 // CHECK41-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4903 // CHECK41-NEXT: [[I3:%.*]] = alloca i32, align 4
4904 // CHECK41-NEXT: store i32 0, ptr [[RETVAL]], align 4
4905 // CHECK41-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4906 // CHECK41-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
4907 // CHECK41-NEXT: store i32 100, ptr [[N]], align 4
4908 // CHECK41-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
4909 // CHECK41-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
4910 // CHECK41-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
4911 // CHECK41-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
4912 // CHECK41-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
4913 // CHECK41-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
4914 // CHECK41-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
4915 // CHECK41-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
4916 // CHECK41-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4917 // CHECK41-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
4918 // CHECK41-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
4919 // CHECK41-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
4920 // CHECK41-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
4921 // CHECK41-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4922 // CHECK41-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
4923 // CHECK41-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
4924 // CHECK41-NEXT: store i32 0, ptr [[I]], align 4
4925 // CHECK41-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4926 // CHECK41-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP6]]
4927 // CHECK41-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
4928 // CHECK41: simd.if.then:
4929 // CHECK41-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4930 // CHECK41-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
4931 // CHECK41-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4932 // CHECK41: omp.inner.for.cond:
4933 // CHECK41-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
4934 // CHECK41-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
4935 // CHECK41-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
4936 // CHECK41-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4937 // CHECK41: omp.inner.for.body:
4938 // CHECK41-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
4939 // CHECK41-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
4940 // CHECK41-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4941 // CHECK41-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP2]]
4942 // CHECK41-NEXT: [[TMP11:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP2]]
4943 // CHECK41-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
4944 // CHECK41-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 [[IDXPROM]]
4945 // CHECK41-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
4946 // CHECK41-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4947 // CHECK41: omp.body.continue:
4948 // CHECK41-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4949 // CHECK41: omp.inner.for.inc:
4950 // CHECK41-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
4951 // CHECK41-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP12]], 1
4952 // CHECK41-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
4953 // CHECK41-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
4954 // CHECK41: omp.inner.for.end:
4955 // CHECK41-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
4956 // CHECK41-NEXT: [[SUB6:%.*]] = sub nsw i32 [[TMP13]], 0
4957 // CHECK41-NEXT: [[DIV7:%.*]] = sdiv i32 [[SUB6]], 1
4958 // CHECK41-NEXT: [[MUL8:%.*]] = mul nsw i32 [[DIV7]], 1
4959 // CHECK41-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
4960 // CHECK41-NEXT: store i32 [[ADD9]], ptr [[I3]], align 4
4961 // CHECK41-NEXT: br label [[SIMD_IF_END]]
4962 // CHECK41: simd.if.end:
4963 // CHECK41-NEXT: [[TMP14:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
4964 // CHECK41-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP14]])
4965 // CHECK41-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
4966 // CHECK41-NEXT: [[TMP15:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
4967 // CHECK41-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP15]])
4968 // CHECK41-NEXT: [[TMP16:%.*]] = load i32, ptr [[RETVAL]], align 4
4969 // CHECK41-NEXT: ret i32 [[TMP16]]
4972 // CHECK41-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
4973 // CHECK41-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR2:[0-9]+]] comdat {
4974 // CHECK41-NEXT: entry:
4975 // CHECK41-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
4976 // CHECK41-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
4977 // CHECK41-NEXT: [[TE:%.*]] = alloca i32, align 4
4978 // CHECK41-NEXT: [[TH:%.*]] = alloca i32, align 4
4979 // CHECK41-NEXT: [[TMP:%.*]] = alloca i32, align 4
4980 // CHECK41-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4981 // CHECK41-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4982 // CHECK41-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4983 // CHECK41-NEXT: [[I:%.*]] = alloca i32, align 4
4984 // CHECK41-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
4985 // CHECK41-NEXT: store i32 0, ptr [[TE]], align 4
4986 // CHECK41-NEXT: store i32 128, ptr [[TH]], align 4
4987 // CHECK41-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4988 // CHECK41-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
4989 // CHECK41-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4990 // CHECK41-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
4991 // CHECK41-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4992 // CHECK41: omp.inner.for.cond:
4993 // CHECK41-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
4994 // CHECK41-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP6]]
4995 // CHECK41-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
4996 // CHECK41-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4997 // CHECK41: omp.inner.for.body:
4998 // CHECK41-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
4999 // CHECK41-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
5000 // CHECK41-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5001 // CHECK41-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP6]]
5002 // CHECK41-NEXT: [[TMP4:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP6]]
5003 // CHECK41-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP4]] to i64
5004 // CHECK41-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
5005 // CHECK41-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP6]]
5006 // CHECK41-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5007 // CHECK41: omp.body.continue:
5008 // CHECK41-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5009 // CHECK41: omp.inner.for.inc:
5010 // CHECK41-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
5011 // CHECK41-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP5]], 1
5012 // CHECK41-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP6]]
5013 // CHECK41-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP7:![0-9]+]]
5014 // CHECK41: omp.inner.for.end:
5015 // CHECK41-NEXT: store i32 10, ptr [[I]], align 4
5016 // CHECK41-NEXT: ret i32 0
5019 // CHECK43-LABEL: define {{[^@]+}}@main
5020 // CHECK43-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
5021 // CHECK43-NEXT: entry:
5022 // CHECK43-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
5023 // CHECK43-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5024 // CHECK43-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
5025 // CHECK43-NEXT: [[N:%.*]] = alloca i32, align 4
5026 // CHECK43-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
5027 // CHECK43-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
5028 // CHECK43-NEXT: [[TMP:%.*]] = alloca i32, align 4
5029 // CHECK43-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
5030 // CHECK43-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
5031 // CHECK43-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5032 // CHECK43-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5033 // CHECK43-NEXT: [[I:%.*]] = alloca i32, align 4
5034 // CHECK43-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5035 // CHECK43-NEXT: [[I3:%.*]] = alloca i32, align 4
5036 // CHECK43-NEXT: store i32 0, ptr [[RETVAL]], align 4
5037 // CHECK43-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5038 // CHECK43-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
5039 // CHECK43-NEXT: store i32 100, ptr [[N]], align 4
5040 // CHECK43-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
5041 // CHECK43-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
5042 // CHECK43-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
5043 // CHECK43-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
5044 // CHECK43-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
5045 // CHECK43-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
5046 // CHECK43-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
5047 // CHECK43-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
5048 // CHECK43-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
5049 // CHECK43-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
5050 // CHECK43-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
5051 // CHECK43-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
5052 // CHECK43-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5053 // CHECK43-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5054 // CHECK43-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_UB]], align 4
5055 // CHECK43-NEXT: store i32 0, ptr [[I]], align 4
5056 // CHECK43-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
5057 // CHECK43-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
5058 // CHECK43-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
5059 // CHECK43: simd.if.then:
5060 // CHECK43-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5061 // CHECK43-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5062 // CHECK43-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5063 // CHECK43: omp.inner.for.cond:
5064 // CHECK43-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
5065 // CHECK43-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
5066 // CHECK43-NEXT: [[CMP4:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5067 // CHECK43-NEXT: br i1 [[CMP4]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5068 // CHECK43: omp.inner.for.body:
5069 // CHECK43-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
5070 // CHECK43-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5071 // CHECK43-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5072 // CHECK43-NEXT: store i32 [[ADD]], ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP3]]
5073 // CHECK43-NEXT: [[TMP10:%.*]] = load i32, ptr [[I3]], align 4, !llvm.access.group [[ACC_GRP3]]
5074 // CHECK43-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 [[TMP10]]
5075 // CHECK43-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
5076 // CHECK43-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5077 // CHECK43: omp.body.continue:
5078 // CHECK43-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5079 // CHECK43: omp.inner.for.inc:
5080 // CHECK43-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
5081 // CHECK43-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP11]], 1
5082 // CHECK43-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
5083 // CHECK43-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
5084 // CHECK43: omp.inner.for.end:
5085 // CHECK43-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
5086 // CHECK43-NEXT: [[SUB6:%.*]] = sub nsw i32 [[TMP12]], 0
5087 // CHECK43-NEXT: [[DIV7:%.*]] = sdiv i32 [[SUB6]], 1
5088 // CHECK43-NEXT: [[MUL8:%.*]] = mul nsw i32 [[DIV7]], 1
5089 // CHECK43-NEXT: [[ADD9:%.*]] = add nsw i32 0, [[MUL8]]
5090 // CHECK43-NEXT: store i32 [[ADD9]], ptr [[I3]], align 4
5091 // CHECK43-NEXT: br label [[SIMD_IF_END]]
5092 // CHECK43: simd.if.end:
5093 // CHECK43-NEXT: [[TMP13:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5094 // CHECK43-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP13]])
5095 // CHECK43-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
5096 // CHECK43-NEXT: [[TMP14:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
5097 // CHECK43-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP14]])
5098 // CHECK43-NEXT: [[TMP15:%.*]] = load i32, ptr [[RETVAL]], align 4
5099 // CHECK43-NEXT: ret i32 [[TMP15]]
5102 // CHECK43-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
5103 // CHECK43-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR2:[0-9]+]] comdat {
5104 // CHECK43-NEXT: entry:
5105 // CHECK43-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5106 // CHECK43-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
5107 // CHECK43-NEXT: [[TE:%.*]] = alloca i32, align 4
5108 // CHECK43-NEXT: [[TH:%.*]] = alloca i32, align 4
5109 // CHECK43-NEXT: [[TMP:%.*]] = alloca i32, align 4
5110 // CHECK43-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5111 // CHECK43-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5112 // CHECK43-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5113 // CHECK43-NEXT: [[I:%.*]] = alloca i32, align 4
5114 // CHECK43-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5115 // CHECK43-NEXT: store i32 0, ptr [[TE]], align 4
5116 // CHECK43-NEXT: store i32 128, ptr [[TH]], align 4
5117 // CHECK43-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5118 // CHECK43-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
5119 // CHECK43-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5120 // CHECK43-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
5121 // CHECK43-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5122 // CHECK43: omp.inner.for.cond:
5123 // CHECK43-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP7:![0-9]+]]
5124 // CHECK43-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP7]]
5125 // CHECK43-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
5126 // CHECK43-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5127 // CHECK43: omp.inner.for.body:
5128 // CHECK43-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP7]]
5129 // CHECK43-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
5130 // CHECK43-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5131 // CHECK43-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP7]]
5132 // CHECK43-NEXT: [[TMP4:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP7]]
5133 // CHECK43-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[A]], i32 0, i32 [[TMP4]]
5134 // CHECK43-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP7]]
5135 // CHECK43-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5136 // CHECK43: omp.body.continue:
5137 // CHECK43-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5138 // CHECK43: omp.inner.for.inc:
5139 // CHECK43-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP7]]
5140 // CHECK43-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP5]], 1
5141 // CHECK43-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP7]]
5142 // CHECK43-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP8:![0-9]+]]
5143 // CHECK43: omp.inner.for.end:
5144 // CHECK43-NEXT: store i32 10, ptr [[I]], align 4
5145 // CHECK43-NEXT: ret i32 0
5148 // CHECK45-LABEL: define {{[^@]+}}@main
5149 // CHECK45-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
5150 // CHECK45-NEXT: entry:
5151 // CHECK45-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
5152 // CHECK45-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5153 // CHECK45-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
5154 // CHECK45-NEXT: [[N:%.*]] = alloca i32, align 4
5155 // CHECK45-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
5156 // CHECK45-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
5157 // CHECK45-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
5158 // CHECK45-NEXT: [[TMP:%.*]] = alloca i32, align 4
5159 // CHECK45-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
5160 // CHECK45-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
5161 // CHECK45-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5162 // CHECK45-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5163 // CHECK45-NEXT: [[I:%.*]] = alloca i32, align 4
5164 // CHECK45-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5165 // CHECK45-NEXT: [[I4:%.*]] = alloca i32, align 4
5166 // CHECK45-NEXT: store i32 0, ptr [[RETVAL]], align 4
5167 // CHECK45-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5168 // CHECK45-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
5169 // CHECK45-NEXT: store i32 100, ptr [[N]], align 4
5170 // CHECK45-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
5171 // CHECK45-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
5172 // CHECK45-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
5173 // CHECK45-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
5174 // CHECK45-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
5175 // CHECK45-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
5176 // CHECK45-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5177 // CHECK45-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP3]], 0
5178 // CHECK45-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
5179 // CHECK45-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
5180 // CHECK45-NEXT: [[TMP4:%.*]] = load i32, ptr [[N]], align 4
5181 // CHECK45-NEXT: store i32 [[TMP4]], ptr [[DOTCAPTURE_EXPR_1]], align 4
5182 // CHECK45-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5183 // CHECK45-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP5]], 0
5184 // CHECK45-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
5185 // CHECK45-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
5186 // CHECK45-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
5187 // CHECK45-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5188 // CHECK45-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
5189 // CHECK45-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
5190 // CHECK45-NEXT: store i32 0, ptr [[I]], align 4
5191 // CHECK45-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5192 // CHECK45-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP7]]
5193 // CHECK45-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
5194 // CHECK45: simd.if.then:
5195 // CHECK45-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5196 // CHECK45-NEXT: store i32 [[TMP8]], ptr [[DOTOMP_IV]], align 4
5197 // CHECK45-NEXT: [[TMP9:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
5198 // CHECK45-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP9]] to i1
5199 // CHECK45-NEXT: br i1 [[TOBOOL5]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
5200 // CHECK45: omp_if.then:
5201 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5202 // CHECK45: omp.inner.for.cond:
5203 // CHECK45-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
5204 // CHECK45-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
5205 // CHECK45-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP10]], [[TMP11]]
5206 // CHECK45-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5207 // CHECK45: omp.inner.for.body:
5208 // CHECK45-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
5209 // CHECK45-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP12]], 1
5210 // CHECK45-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5211 // CHECK45-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP2]]
5212 // CHECK45-NEXT: [[TMP13:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP2]]
5213 // CHECK45-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP13]] to i64
5214 // CHECK45-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 [[IDXPROM]]
5215 // CHECK45-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP2]]
5216 // CHECK45-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5217 // CHECK45: omp.body.continue:
5218 // CHECK45-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5219 // CHECK45: omp.inner.for.inc:
5220 // CHECK45-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
5221 // CHECK45-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP14]], 1
5222 // CHECK45-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
5223 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
5224 // CHECK45: omp.inner.for.end:
5225 // CHECK45-NEXT: br label [[OMP_IF_END:%.*]]
5226 // CHECK45: omp_if.else:
5227 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND8:%.*]]
5228 // CHECK45: omp.inner.for.cond8:
5229 // CHECK45-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5230 // CHECK45-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5231 // CHECK45-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
5232 // CHECK45-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY10:%.*]], label [[OMP_INNER_FOR_END18:%.*]]
5233 // CHECK45: omp.inner.for.body10:
5234 // CHECK45-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5235 // CHECK45-NEXT: [[MUL11:%.*]] = mul nsw i32 [[TMP17]], 1
5236 // CHECK45-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
5237 // CHECK45-NEXT: store i32 [[ADD12]], ptr [[I4]], align 4
5238 // CHECK45-NEXT: [[TMP18:%.*]] = load i32, ptr [[I4]], align 4
5239 // CHECK45-NEXT: [[IDXPROM13:%.*]] = sext i32 [[TMP18]] to i64
5240 // CHECK45-NEXT: [[ARRAYIDX14:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 [[IDXPROM13]]
5241 // CHECK45-NEXT: store i32 0, ptr [[ARRAYIDX14]], align 4
5242 // CHECK45-NEXT: br label [[OMP_BODY_CONTINUE15:%.*]]
5243 // CHECK45: omp.body.continue15:
5244 // CHECK45-NEXT: br label [[OMP_INNER_FOR_INC16:%.*]]
5245 // CHECK45: omp.inner.for.inc16:
5246 // CHECK45-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5247 // CHECK45-NEXT: [[ADD17:%.*]] = add nsw i32 [[TMP19]], 1
5248 // CHECK45-NEXT: store i32 [[ADD17]], ptr [[DOTOMP_IV]], align 4
5249 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND8]], !llvm.loop [[LOOP6:![0-9]+]]
5250 // CHECK45: omp.inner.for.end18:
5251 // CHECK45-NEXT: br label [[OMP_IF_END]]
5252 // CHECK45: omp_if.end:
5253 // CHECK45-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5254 // CHECK45-NEXT: [[SUB19:%.*]] = sub nsw i32 [[TMP20]], 0
5255 // CHECK45-NEXT: [[DIV20:%.*]] = sdiv i32 [[SUB19]], 1
5256 // CHECK45-NEXT: [[MUL21:%.*]] = mul nsw i32 [[DIV20]], 1
5257 // CHECK45-NEXT: [[ADD22:%.*]] = add nsw i32 0, [[MUL21]]
5258 // CHECK45-NEXT: store i32 [[ADD22]], ptr [[I4]], align 4
5259 // CHECK45-NEXT: br label [[SIMD_IF_END]]
5260 // CHECK45: simd.if.end:
5261 // CHECK45-NEXT: [[TMP21:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5262 // CHECK45-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP21]])
5263 // CHECK45-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
5264 // CHECK45-NEXT: [[TMP22:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
5265 // CHECK45-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP22]])
5266 // CHECK45-NEXT: [[TMP23:%.*]] = load i32, ptr [[RETVAL]], align 4
5267 // CHECK45-NEXT: ret i32 [[TMP23]]
5270 // CHECK45-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
5271 // CHECK45-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR2:[0-9]+]] comdat {
5272 // CHECK45-NEXT: entry:
5273 // CHECK45-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5274 // CHECK45-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
5275 // CHECK45-NEXT: [[TE:%.*]] = alloca i32, align 4
5276 // CHECK45-NEXT: [[TH:%.*]] = alloca i32, align 4
5277 // CHECK45-NEXT: [[TMP:%.*]] = alloca i32, align 4
5278 // CHECK45-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5279 // CHECK45-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5280 // CHECK45-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5281 // CHECK45-NEXT: [[I:%.*]] = alloca i32, align 4
5282 // CHECK45-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5283 // CHECK45-NEXT: store i32 0, ptr [[TE]], align 4
5284 // CHECK45-NEXT: store i32 128, ptr [[TH]], align 4
5285 // CHECK45-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5286 // CHECK45-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
5287 // CHECK45-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5288 // CHECK45-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
5289 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5290 // CHECK45: omp.inner.for.cond:
5291 // CHECK45-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8:![0-9]+]]
5292 // CHECK45-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP8]]
5293 // CHECK45-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
5294 // CHECK45-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5295 // CHECK45: omp.inner.for.body:
5296 // CHECK45-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8]]
5297 // CHECK45-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
5298 // CHECK45-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5299 // CHECK45-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP8]]
5300 // CHECK45-NEXT: [[TMP4:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP8]]
5301 // CHECK45-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP4]] to i64
5302 // CHECK45-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
5303 // CHECK45-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP8]]
5304 // CHECK45-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5305 // CHECK45: omp.body.continue:
5306 // CHECK45-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5307 // CHECK45: omp.inner.for.inc:
5308 // CHECK45-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8]]
5309 // CHECK45-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP5]], 1
5310 // CHECK45-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8]]
5311 // CHECK45-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP9:![0-9]+]]
5312 // CHECK45: omp.inner.for.end:
5313 // CHECK45-NEXT: store i32 10, ptr [[I]], align 4
5314 // CHECK45-NEXT: ret i32 0
5317 // CHECK47-LABEL: define {{[^@]+}}@main
5318 // CHECK47-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
5319 // CHECK47-NEXT: entry:
5320 // CHECK47-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
5321 // CHECK47-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5322 // CHECK47-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
5323 // CHECK47-NEXT: [[N:%.*]] = alloca i32, align 4
5324 // CHECK47-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
5325 // CHECK47-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
5326 // CHECK47-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
5327 // CHECK47-NEXT: [[TMP:%.*]] = alloca i32, align 4
5328 // CHECK47-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
5329 // CHECK47-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
5330 // CHECK47-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5331 // CHECK47-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5332 // CHECK47-NEXT: [[I:%.*]] = alloca i32, align 4
5333 // CHECK47-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5334 // CHECK47-NEXT: [[I4:%.*]] = alloca i32, align 4
5335 // CHECK47-NEXT: store i32 0, ptr [[RETVAL]], align 4
5336 // CHECK47-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5337 // CHECK47-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
5338 // CHECK47-NEXT: store i32 100, ptr [[N]], align 4
5339 // CHECK47-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
5340 // CHECK47-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
5341 // CHECK47-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
5342 // CHECK47-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
5343 // CHECK47-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
5344 // CHECK47-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5345 // CHECK47-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP2]], 0
5346 // CHECK47-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
5347 // CHECK47-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
5348 // CHECK47-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
5349 // CHECK47-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
5350 // CHECK47-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5351 // CHECK47-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
5352 // CHECK47-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
5353 // CHECK47-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
5354 // CHECK47-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
5355 // CHECK47-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5356 // CHECK47-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
5357 // CHECK47-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
5358 // CHECK47-NEXT: store i32 0, ptr [[I]], align 4
5359 // CHECK47-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5360 // CHECK47-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP6]]
5361 // CHECK47-NEXT: br i1 [[CMP]], label [[SIMD_IF_THEN:%.*]], label [[SIMD_IF_END:%.*]]
5362 // CHECK47: simd.if.then:
5363 // CHECK47-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5364 // CHECK47-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
5365 // CHECK47-NEXT: [[TMP8:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
5366 // CHECK47-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP8]] to i1
5367 // CHECK47-NEXT: br i1 [[TOBOOL5]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
5368 // CHECK47: omp_if.then:
5369 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5370 // CHECK47: omp.inner.for.cond:
5371 // CHECK47-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3:![0-9]+]]
5372 // CHECK47-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP3]]
5373 // CHECK47-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP9]], [[TMP10]]
5374 // CHECK47-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5375 // CHECK47: omp.inner.for.body:
5376 // CHECK47-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
5377 // CHECK47-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP11]], 1
5378 // CHECK47-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5379 // CHECK47-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP3]]
5380 // CHECK47-NEXT: [[TMP12:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP3]]
5381 // CHECK47-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 [[TMP12]]
5382 // CHECK47-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP3]]
5383 // CHECK47-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5384 // CHECK47: omp.body.continue:
5385 // CHECK47-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5386 // CHECK47: omp.inner.for.inc:
5387 // CHECK47-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
5388 // CHECK47-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP13]], 1
5389 // CHECK47-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP3]]
5390 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP4:![0-9]+]]
5391 // CHECK47: omp.inner.for.end:
5392 // CHECK47-NEXT: br label [[OMP_IF_END:%.*]]
5393 // CHECK47: omp_if.else:
5394 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND8:%.*]]
5395 // CHECK47: omp.inner.for.cond8:
5396 // CHECK47-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5397 // CHECK47-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5398 // CHECK47-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
5399 // CHECK47-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY10:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
5400 // CHECK47: omp.inner.for.body10:
5401 // CHECK47-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5402 // CHECK47-NEXT: [[MUL11:%.*]] = mul nsw i32 [[TMP16]], 1
5403 // CHECK47-NEXT: [[ADD12:%.*]] = add nsw i32 0, [[MUL11]]
5404 // CHECK47-NEXT: store i32 [[ADD12]], ptr [[I4]], align 4
5405 // CHECK47-NEXT: [[TMP17:%.*]] = load i32, ptr [[I4]], align 4
5406 // CHECK47-NEXT: [[ARRAYIDX13:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 [[TMP17]]
5407 // CHECK47-NEXT: store i32 0, ptr [[ARRAYIDX13]], align 4
5408 // CHECK47-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
5409 // CHECK47: omp.body.continue14:
5410 // CHECK47-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
5411 // CHECK47: omp.inner.for.inc15:
5412 // CHECK47-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
5413 // CHECK47-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP18]], 1
5414 // CHECK47-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
5415 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND8]], !llvm.loop [[LOOP7:![0-9]+]]
5416 // CHECK47: omp.inner.for.end17:
5417 // CHECK47-NEXT: br label [[OMP_IF_END]]
5418 // CHECK47: omp_if.end:
5419 // CHECK47-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
5420 // CHECK47-NEXT: [[SUB18:%.*]] = sub nsw i32 [[TMP19]], 0
5421 // CHECK47-NEXT: [[DIV19:%.*]] = sdiv i32 [[SUB18]], 1
5422 // CHECK47-NEXT: [[MUL20:%.*]] = mul nsw i32 [[DIV19]], 1
5423 // CHECK47-NEXT: [[ADD21:%.*]] = add nsw i32 0, [[MUL20]]
5424 // CHECK47-NEXT: store i32 [[ADD21]], ptr [[I4]], align 4
5425 // CHECK47-NEXT: br label [[SIMD_IF_END]]
5426 // CHECK47: simd.if.end:
5427 // CHECK47-NEXT: [[TMP20:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
5428 // CHECK47-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP20]])
5429 // CHECK47-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
5430 // CHECK47-NEXT: [[TMP21:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
5431 // CHECK47-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP21]])
5432 // CHECK47-NEXT: [[TMP22:%.*]] = load i32, ptr [[RETVAL]], align 4
5433 // CHECK47-NEXT: ret i32 [[TMP22]]
5436 // CHECK47-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
5437 // CHECK47-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR2:[0-9]+]] comdat {
5438 // CHECK47-NEXT: entry:
5439 // CHECK47-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
5440 // CHECK47-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
5441 // CHECK47-NEXT: [[TE:%.*]] = alloca i32, align 4
5442 // CHECK47-NEXT: [[TH:%.*]] = alloca i32, align 4
5443 // CHECK47-NEXT: [[TMP:%.*]] = alloca i32, align 4
5444 // CHECK47-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5445 // CHECK47-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5446 // CHECK47-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5447 // CHECK47-NEXT: [[I:%.*]] = alloca i32, align 4
5448 // CHECK47-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
5449 // CHECK47-NEXT: store i32 0, ptr [[TE]], align 4
5450 // CHECK47-NEXT: store i32 128, ptr [[TH]], align 4
5451 // CHECK47-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5452 // CHECK47-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
5453 // CHECK47-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5454 // CHECK47-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
5455 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5456 // CHECK47: omp.inner.for.cond:
5457 // CHECK47-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
5458 // CHECK47-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
5459 // CHECK47-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
5460 // CHECK47-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5461 // CHECK47: omp.inner.for.body:
5462 // CHECK47-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
5463 // CHECK47-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
5464 // CHECK47-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5465 // CHECK47-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
5466 // CHECK47-NEXT: [[TMP4:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
5467 // CHECK47-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[A]], i32 0, i32 [[TMP4]]
5468 // CHECK47-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP9]]
5469 // CHECK47-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5470 // CHECK47: omp.body.continue:
5471 // CHECK47-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5472 // CHECK47: omp.inner.for.inc:
5473 // CHECK47-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
5474 // CHECK47-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP5]], 1
5475 // CHECK47-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
5476 // CHECK47-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
5477 // CHECK47: omp.inner.for.end:
5478 // CHECK47-NEXT: store i32 10, ptr [[I]], align 4
5479 // CHECK47-NEXT: ret i32 0