Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / target_data_map_codegen_hold.cpp
blob4593927a1230c73ab282ffe5bbb19463847150b8
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals --prefix-filecheck-ir-name _ --global-value-regex ".offload_maptypes.*" ".offload_sizes.*" --global-hex-value-regex ".offload_maptypes.*"
2 // expected-no-diagnostics
3 #ifndef HEADER
4 #define HEADER
6 // powerpc64le-ibm-linux-gnu
8 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-extensions \
9 // RUN: -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ \
10 // RUN: -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | \
11 // RUN: FileCheck %s --check-prefixes=CHECK-PPC64LE
12 // RUN: %clang_cc1 -fopenmp -fopenmp-extensions \
13 // RUN: -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 \
14 // RUN: -triple powerpc64le-unknown-unknown -emit-pch -o %t %s
15 // RUN: %clang_cc1 -fopenmp -fopenmp-extensions \
16 // RUN: -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ \
17 // RUN: -triple powerpc64le-unknown-unknown -std=c++11 -include-pch %t \
18 // RUN: -verify %s -emit-llvm -o - | \
19 // RUN: FileCheck %s --check-prefixes=CHECK-PPC64LE
21 // i386-pc-linux-gnu
23 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-extensions \
24 // RUN: -fopenmp-targets=i386-pc-linux-gnu -x c++ \
25 // RUN: -triple i386-unknown-unknown -emit-llvm %s -o - | \
26 // RUN: FileCheck %s --check-prefixes=CHECK-I386
27 // RUN: %clang_cc1 -fopenmp -fopenmp-extensions \
28 // RUN: -fopenmp-targets=i386-pc-linux-gnu -x c++ -std=c++11 \
29 // RUN: -triple i386-unknown-unknown -emit-pch -o %t %s
30 // RUN: %clang_cc1 -fopenmp -fopenmp-extensions \
31 // RUN: -fopenmp-targets=i386-pc-linux-gnu -x c++ \
32 // RUN: -triple i386-unknown-unknown -std=c++11 -include-pch %t -verify %s \
33 // RUN: -emit-llvm -o - | \
34 // RUN: FileCheck %s --check-prefixes=CHECK-I386
36 struct S1 {
37 int i;
39 struct S2 {
40 S1 s;
41 struct S2 *ps;
44 // Map flags used in @.offload_maptypes* below:
46 // TO = 0x1
47 // FROM = 0x2
48 // ALWAYS = 0x4
49 // PTR_AND_OBJ = 0x10
50 // CLOSE = 0x400
51 // OMPX_HOLD = 0x2000
52 // MEMBER_OF_1 = 0x1000000000000
53 // MEMBER_OF_7 = 0x7000000000000
55 //.
56 // CHECK-PPC64LE: @.offload_sizes = private unnamed_addr constant [1 x i64] [i64 20]
57 // CHECK-PPC64LE: @.offload_maptypes = private unnamed_addr constant [1 x i64] [i64 [[#0x2001]]]
58 // CHECK-PPC64LE: @.offload_sizes.1 = private unnamed_addr constant [1 x i64] [i64 20]
59 // CHECK-PPC64LE: @.offload_maptypes.2 = private unnamed_addr constant [1 x i64] [i64 [[#0x2405]]]
60 // CHECK-PPC64LE: @.offload_sizes.3 = private unnamed_addr constant [1 x i64] [i64 4]
61 // CHECK-PPC64LE: @.offload_maptypes.4 = private unnamed_addr constant [1 x i64] [i64 [[#0x2003]]]
62 // CHECK-PPC64LE: @.offload_sizes.5 = private unnamed_addr constant [11 x i64] [i64 0, i64 4, i64 8, i64 8, i64 4, i64 4, i64 0, i64 4, i64 8, i64 8, i64 4]
63 // CHECK-PPC64LE: @.offload_maptypes.6 = private unnamed_addr constant [11 x i64] [i64 [[#0x2000]], i64 [[#0x1000000002003]], i64 [[#0x1000000002010]], i64 [[#0x2010]], i64 [[#0x2013]], i64 [[#0x3]], i64 [[#0x2000]], i64 [[#0x7000000002003]], i64 [[#0x7000000002010]], i64 [[#0x2010]], i64 [[#0x2013]]]
64 //.
65 // CHECK-I386: @.offload_sizes = private unnamed_addr constant [1 x i64] [i64 20]
66 // CHECK-I386: @.offload_maptypes = private unnamed_addr constant [1 x i64] [i64 [[#0x2001]]]
67 // CHECK-I386: @.offload_sizes.1 = private unnamed_addr constant [1 x i64] [i64 20]
68 // CHECK-I386: @.offload_maptypes.2 = private unnamed_addr constant [1 x i64] [i64 [[#0x2405]]]
69 // CHECK-I386: @.offload_sizes.3 = private unnamed_addr constant [1 x i64] [i64 4]
70 // CHECK-I386: @.offload_maptypes.4 = private unnamed_addr constant [1 x i64] [i64 [[#0x2003]]]
71 // CHECK-I386: @.offload_sizes.5 = private unnamed_addr constant [11 x i64] [i64 0, i64 4, i64 4, i64 4, i64 4, i64 4, i64 0, i64 4, i64 4, i64 4, i64 4]
72 // CHECK-I386: @.offload_maptypes.6 = private unnamed_addr constant [11 x i64] [i64 [[#0x2000]], i64 [[#0x1000000002003]], i64 [[#0x1000000002010]], i64 [[#0x2010]], i64 [[#0x2013]], i64 [[#0x3]], i64 [[#0x2000]], i64 [[#0x7000000002003]], i64 [[#0x7000000002010]], i64 [[#0x2010]], i64 [[#0x2013]]]
73 //.
74 // CHECK-PPC64LE-LABEL: @_Z3fooi(
75 // CHECK-PPC64LE-NEXT: entry:
76 // CHECK-PPC64LE-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
77 // CHECK-PPC64LE-NEXT: [[LB:%.*]] = alloca [5 x float], align 4
78 // CHECK-PPC64LE-NEXT: [[PS1:%.*]] = alloca ptr, align 8
79 // CHECK-PPC64LE-NEXT: [[PS2:%.*]] = alloca ptr, align 8
80 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
81 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
82 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
83 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_BASEPTRS1:%.*]] = alloca [1 x ptr], align 8
84 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_PTRS2:%.*]] = alloca [1 x ptr], align 8
85 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_MAPPERS3:%.*]] = alloca [1 x ptr], align 8
86 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_BASEPTRS5:%.*]] = alloca [1 x ptr], align 8
87 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_PTRS6:%.*]] = alloca [1 x ptr], align 8
88 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_MAPPERS7:%.*]] = alloca [1 x ptr], align 8
89 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_BASEPTRS29:%.*]] = alloca [11 x ptr], align 8
90 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_PTRS30:%.*]] = alloca [11 x ptr], align 8
91 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_MAPPERS31:%.*]] = alloca [11 x ptr], align 8
92 // CHECK-PPC64LE-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [11 x i64], align 8
93 // CHECK-PPC64LE-NEXT: store i32 [[ARG:%.*]], ptr [[ARG_ADDR]], align 4
94 // CHECK-PPC64LE-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
95 // CHECK-PPC64LE-NEXT: store ptr [[LB]], ptr [[TMP0]], align 8
96 // CHECK-PPC64LE-NEXT: [[TMP1:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
97 // CHECK-PPC64LE-NEXT: store ptr [[LB]], ptr [[TMP1]], align 8
98 // CHECK-PPC64LE-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
99 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP2]], align 8
100 // CHECK-PPC64LE-NEXT: [[TMP3:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
101 // CHECK-PPC64LE-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
102 // CHECK-PPC64LE-NEXT: call void @__tgt_target_data_begin_mapper(ptr @[[GLOB1:[0-9]+]], i64 -1, i32 1, ptr [[TMP3]], ptr [[TMP4]], ptr @.offload_sizes, ptr @.offload_maptypes, ptr null, ptr null)
103 // CHECK-PPC64LE-NEXT: [[TMP5:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
104 // CHECK-PPC64LE-NEXT: [[INC:%.*]] = add nsw i32 [[TMP5]], 1
105 // CHECK-PPC64LE-NEXT: store i32 [[INC]], ptr [[ARG_ADDR]], align 4
106 // CHECK-PPC64LE-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
107 // CHECK-PPC64LE-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
108 // CHECK-PPC64LE-NEXT: call void @__tgt_target_data_end_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP6]], ptr [[TMP7]], ptr @.offload_sizes, ptr @.offload_maptypes, ptr null, ptr null)
109 // CHECK-PPC64LE-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
110 // CHECK-PPC64LE-NEXT: store ptr [[LB]], ptr [[TMP8]], align 8
111 // CHECK-PPC64LE-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
112 // CHECK-PPC64LE-NEXT: store ptr [[LB]], ptr [[TMP9]], align 8
113 // CHECK-PPC64LE-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS3]], i64 0, i64 0
114 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP10]], align 8
115 // CHECK-PPC64LE-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
116 // CHECK-PPC64LE-NEXT: [[TMP12:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
117 // CHECK-PPC64LE-NEXT: call void @__tgt_target_data_begin_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP11]], ptr [[TMP12]], ptr @.offload_sizes.1, ptr @.offload_maptypes.2, ptr null, ptr null)
118 // CHECK-PPC64LE-NEXT: [[TMP13:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
119 // CHECK-PPC64LE-NEXT: [[INC4:%.*]] = add nsw i32 [[TMP13]], 1
120 // CHECK-PPC64LE-NEXT: store i32 [[INC4]], ptr [[ARG_ADDR]], align 4
121 // CHECK-PPC64LE-NEXT: [[TMP14:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
122 // CHECK-PPC64LE-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
123 // CHECK-PPC64LE-NEXT: call void @__tgt_target_data_end_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP14]], ptr [[TMP15]], ptr @.offload_sizes.1, ptr @.offload_maptypes.2, ptr null, ptr null)
124 // CHECK-PPC64LE-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
125 // CHECK-PPC64LE-NEXT: store ptr [[ARG_ADDR]], ptr [[TMP16]], align 8
126 // CHECK-PPC64LE-NEXT: [[TMP17:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
127 // CHECK-PPC64LE-NEXT: store ptr [[ARG_ADDR]], ptr [[TMP17]], align 8
128 // CHECK-PPC64LE-NEXT: [[TMP18:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i64 0, i64 0
129 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP18]], align 8
130 // CHECK-PPC64LE-NEXT: [[TMP19:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
131 // CHECK-PPC64LE-NEXT: [[TMP20:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
132 // CHECK-PPC64LE-NEXT: call void @__tgt_target_data_begin_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP19]], ptr [[TMP20]], ptr @.offload_sizes.3, ptr @.offload_maptypes.4, ptr null, ptr null)
133 // CHECK-PPC64LE-NEXT: [[TMP21:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
134 // CHECK-PPC64LE-NEXT: [[INC8:%.*]] = add nsw i32 [[TMP21]], 1
135 // CHECK-PPC64LE-NEXT: store i32 [[INC8]], ptr [[ARG_ADDR]], align 4
136 // CHECK-PPC64LE-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
137 // CHECK-PPC64LE-NEXT: [[TMP23:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
138 // CHECK-PPC64LE-NEXT: call void @__tgt_target_data_end_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP22]], ptr [[TMP23]], ptr @.offload_sizes.3, ptr @.offload_maptypes.4, ptr null, ptr null)
139 // CHECK-PPC64LE-NEXT: [[TMP24:%.*]] = load ptr, ptr [[PS1]], align 8
140 // CHECK-PPC64LE-NEXT: [[TMP25:%.*]] = load ptr, ptr [[PS1]], align 8
141 // CHECK-PPC64LE-NEXT: [[S:%.*]] = getelementptr inbounds [[STRUCT_S2:%.*]], ptr [[TMP25]], i32 0, i32 0
142 // CHECK-PPC64LE-NEXT: [[TMP26:%.*]] = load ptr, ptr [[PS1]], align 8
143 // CHECK-PPC64LE-NEXT: [[TMP27:%.*]] = load ptr, ptr [[PS1]], align 8
144 // CHECK-PPC64LE-NEXT: [[PS:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP27]], i32 0, i32 1
145 // CHECK-PPC64LE-NEXT: [[TMP28:%.*]] = load ptr, ptr [[PS1]], align 8
146 // CHECK-PPC64LE-NEXT: [[PS9:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP28]], i32 0, i32 1
147 // CHECK-PPC64LE-NEXT: [[TMP29:%.*]] = load ptr, ptr [[PS9]], align 8
148 // CHECK-PPC64LE-NEXT: [[PS10:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP29]], i32 0, i32 1
149 // CHECK-PPC64LE-NEXT: [[TMP30:%.*]] = load ptr, ptr [[PS1]], align 8
150 // CHECK-PPC64LE-NEXT: [[PS11:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP30]], i32 0, i32 1
151 // CHECK-PPC64LE-NEXT: [[TMP31:%.*]] = load ptr, ptr [[PS11]], align 8
152 // CHECK-PPC64LE-NEXT: [[PS12:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP31]], i32 0, i32 1
153 // CHECK-PPC64LE-NEXT: [[TMP32:%.*]] = load ptr, ptr [[PS12]], align 8
154 // CHECK-PPC64LE-NEXT: [[PS13:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP32]], i32 0, i32 1
155 // CHECK-PPC64LE-NEXT: [[TMP33:%.*]] = load ptr, ptr [[PS1]], align 8
156 // CHECK-PPC64LE-NEXT: [[PS14:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP33]], i32 0, i32 1
157 // CHECK-PPC64LE-NEXT: [[TMP34:%.*]] = load ptr, ptr [[PS14]], align 8
158 // CHECK-PPC64LE-NEXT: [[PS15:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP34]], i32 0, i32 1
159 // CHECK-PPC64LE-NEXT: [[TMP35:%.*]] = load ptr, ptr [[PS15]], align 8
160 // CHECK-PPC64LE-NEXT: [[PS16:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP35]], i32 0, i32 1
161 // CHECK-PPC64LE-NEXT: [[TMP36:%.*]] = load ptr, ptr [[PS16]], align 8
162 // CHECK-PPC64LE-NEXT: [[S17:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP36]], i32 0, i32 0
163 // CHECK-PPC64LE-NEXT: [[TMP37:%.*]] = getelementptr ptr, ptr [[PS]], i32 1
164 // CHECK-PPC64LE-NEXT: [[TMP38:%.*]] = ptrtoint ptr [[TMP37]] to i64
165 // CHECK-PPC64LE-NEXT: [[TMP39:%.*]] = ptrtoint ptr [[S]] to i64
166 // CHECK-PPC64LE-NEXT: [[TMP40:%.*]] = sub i64 [[TMP38]], [[TMP39]]
167 // CHECK-PPC64LE-NEXT: [[TMP41:%.*]] = sdiv exact i64 [[TMP40]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
168 // CHECK-PPC64LE-NEXT: [[TMP42:%.*]] = load ptr, ptr [[PS2]], align 8
169 // CHECK-PPC64LE-NEXT: [[TMP43:%.*]] = load ptr, ptr [[PS2]], align 8
170 // CHECK-PPC64LE-NEXT: [[S18:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP43]], i32 0, i32 0
171 // CHECK-PPC64LE-NEXT: [[TMP44:%.*]] = load ptr, ptr [[PS2]], align 8
172 // CHECK-PPC64LE-NEXT: [[TMP45:%.*]] = load ptr, ptr [[PS2]], align 8
173 // CHECK-PPC64LE-NEXT: [[PS19:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP45]], i32 0, i32 1
174 // CHECK-PPC64LE-NEXT: [[TMP46:%.*]] = load ptr, ptr [[PS2]], align 8
175 // CHECK-PPC64LE-NEXT: [[PS20:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP46]], i32 0, i32 1
176 // CHECK-PPC64LE-NEXT: [[TMP47:%.*]] = load ptr, ptr [[PS20]], align 8
177 // CHECK-PPC64LE-NEXT: [[PS21:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP47]], i32 0, i32 1
178 // CHECK-PPC64LE-NEXT: [[TMP48:%.*]] = load ptr, ptr [[PS2]], align 8
179 // CHECK-PPC64LE-NEXT: [[PS22:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP48]], i32 0, i32 1
180 // CHECK-PPC64LE-NEXT: [[TMP49:%.*]] = load ptr, ptr [[PS22]], align 8
181 // CHECK-PPC64LE-NEXT: [[PS23:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP49]], i32 0, i32 1
182 // CHECK-PPC64LE-NEXT: [[TMP50:%.*]] = load ptr, ptr [[PS23]], align 8
183 // CHECK-PPC64LE-NEXT: [[PS24:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP50]], i32 0, i32 1
184 // CHECK-PPC64LE-NEXT: [[TMP51:%.*]] = load ptr, ptr [[PS2]], align 8
185 // CHECK-PPC64LE-NEXT: [[PS25:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP51]], i32 0, i32 1
186 // CHECK-PPC64LE-NEXT: [[TMP52:%.*]] = load ptr, ptr [[PS25]], align 8
187 // CHECK-PPC64LE-NEXT: [[PS26:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP52]], i32 0, i32 1
188 // CHECK-PPC64LE-NEXT: [[TMP53:%.*]] = load ptr, ptr [[PS26]], align 8
189 // CHECK-PPC64LE-NEXT: [[PS27:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP53]], i32 0, i32 1
190 // CHECK-PPC64LE-NEXT: [[TMP54:%.*]] = load ptr, ptr [[PS27]], align 8
191 // CHECK-PPC64LE-NEXT: [[S28:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP54]], i32 0, i32 0
192 // CHECK-PPC64LE-NEXT: [[TMP55:%.*]] = getelementptr ptr, ptr [[PS19]], i32 1
193 // CHECK-PPC64LE-NEXT: [[TMP56:%.*]] = ptrtoint ptr [[TMP55]] to i64
194 // CHECK-PPC64LE-NEXT: [[TMP57:%.*]] = ptrtoint ptr [[S18]] to i64
195 // CHECK-PPC64LE-NEXT: [[TMP58:%.*]] = sub i64 [[TMP56]], [[TMP57]]
196 // CHECK-PPC64LE-NEXT: [[TMP59:%.*]] = sdiv exact i64 [[TMP58]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
197 // CHECK-PPC64LE-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes.5, i64 88, i1 false)
198 // CHECK-PPC64LE-NEXT: [[TMP60:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 0
199 // CHECK-PPC64LE-NEXT: store ptr [[TMP24]], ptr [[TMP60]], align 8
200 // CHECK-PPC64LE-NEXT: [[TMP61:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 0
201 // CHECK-PPC64LE-NEXT: store ptr [[S]], ptr [[TMP61]], align 8
202 // CHECK-PPC64LE-NEXT: [[TMP62:%.*]] = getelementptr inbounds [11 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
203 // CHECK-PPC64LE-NEXT: store i64 [[TMP41]], ptr [[TMP62]], align 8
204 // CHECK-PPC64LE-NEXT: [[TMP63:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 0
205 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP63]], align 8
206 // CHECK-PPC64LE-NEXT: [[TMP64:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 1
207 // CHECK-PPC64LE-NEXT: store ptr [[TMP24]], ptr [[TMP64]], align 8
208 // CHECK-PPC64LE-NEXT: [[TMP65:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 1
209 // CHECK-PPC64LE-NEXT: store ptr [[S]], ptr [[TMP65]], align 8
210 // CHECK-PPC64LE-NEXT: [[TMP66:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 1
211 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP66]], align 8
212 // CHECK-PPC64LE-NEXT: [[TMP67:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 2
213 // CHECK-PPC64LE-NEXT: store ptr [[PS]], ptr [[TMP67]], align 8
214 // CHECK-PPC64LE-NEXT: [[TMP68:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 2
215 // CHECK-PPC64LE-NEXT: store ptr [[PS10]], ptr [[TMP68]], align 8
216 // CHECK-PPC64LE-NEXT: [[TMP69:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 2
217 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP69]], align 8
218 // CHECK-PPC64LE-NEXT: [[TMP70:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 3
219 // CHECK-PPC64LE-NEXT: store ptr [[PS10]], ptr [[TMP70]], align 8
220 // CHECK-PPC64LE-NEXT: [[TMP71:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 3
221 // CHECK-PPC64LE-NEXT: store ptr [[PS13]], ptr [[TMP71]], align 8
222 // CHECK-PPC64LE-NEXT: [[TMP72:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 3
223 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP72]], align 8
224 // CHECK-PPC64LE-NEXT: [[TMP73:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 4
225 // CHECK-PPC64LE-NEXT: store ptr [[PS13]], ptr [[TMP73]], align 8
226 // CHECK-PPC64LE-NEXT: [[TMP74:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 4
227 // CHECK-PPC64LE-NEXT: store ptr [[S17]], ptr [[TMP74]], align 8
228 // CHECK-PPC64LE-NEXT: [[TMP75:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 4
229 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP75]], align 8
230 // CHECK-PPC64LE-NEXT: [[TMP76:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 5
231 // CHECK-PPC64LE-NEXT: store ptr [[ARG_ADDR]], ptr [[TMP76]], align 8
232 // CHECK-PPC64LE-NEXT: [[TMP77:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 5
233 // CHECK-PPC64LE-NEXT: store ptr [[ARG_ADDR]], ptr [[TMP77]], align 8
234 // CHECK-PPC64LE-NEXT: [[TMP78:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 5
235 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP78]], align 8
236 // CHECK-PPC64LE-NEXT: [[TMP79:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 6
237 // CHECK-PPC64LE-NEXT: store ptr [[TMP42]], ptr [[TMP79]], align 8
238 // CHECK-PPC64LE-NEXT: [[TMP80:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 6
239 // CHECK-PPC64LE-NEXT: store ptr [[S18]], ptr [[TMP80]], align 8
240 // CHECK-PPC64LE-NEXT: [[TMP81:%.*]] = getelementptr inbounds [11 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 6
241 // CHECK-PPC64LE-NEXT: store i64 [[TMP59]], ptr [[TMP81]], align 8
242 // CHECK-PPC64LE-NEXT: [[TMP82:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 6
243 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP82]], align 8
244 // CHECK-PPC64LE-NEXT: [[TMP83:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 7
245 // CHECK-PPC64LE-NEXT: store ptr [[TMP42]], ptr [[TMP83]], align 8
246 // CHECK-PPC64LE-NEXT: [[TMP84:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 7
247 // CHECK-PPC64LE-NEXT: store ptr [[S18]], ptr [[TMP84]], align 8
248 // CHECK-PPC64LE-NEXT: [[TMP85:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 7
249 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP85]], align 8
250 // CHECK-PPC64LE-NEXT: [[TMP86:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 8
251 // CHECK-PPC64LE-NEXT: store ptr [[PS19]], ptr [[TMP86]], align 8
252 // CHECK-PPC64LE-NEXT: [[TMP87:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 8
253 // CHECK-PPC64LE-NEXT: store ptr [[PS21]], ptr [[TMP87]], align 8
254 // CHECK-PPC64LE-NEXT: [[TMP88:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 8
255 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP88]], align 8
256 // CHECK-PPC64LE-NEXT: [[TMP89:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 9
257 // CHECK-PPC64LE-NEXT: store ptr [[PS21]], ptr [[TMP89]], align 8
258 // CHECK-PPC64LE-NEXT: [[TMP90:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 9
259 // CHECK-PPC64LE-NEXT: store ptr [[PS24]], ptr [[TMP90]], align 8
260 // CHECK-PPC64LE-NEXT: [[TMP91:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 9
261 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP91]], align 8
262 // CHECK-PPC64LE-NEXT: [[TMP92:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 10
263 // CHECK-PPC64LE-NEXT: store ptr [[PS24]], ptr [[TMP92]], align 8
264 // CHECK-PPC64LE-NEXT: [[TMP93:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 10
265 // CHECK-PPC64LE-NEXT: store ptr [[S28]], ptr [[TMP93]], align 8
266 // CHECK-PPC64LE-NEXT: [[TMP94:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i64 0, i64 10
267 // CHECK-PPC64LE-NEXT: store ptr null, ptr [[TMP94]], align 8
268 // CHECK-PPC64LE-NEXT: [[TMP95:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 0
269 // CHECK-PPC64LE-NEXT: [[TMP96:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 0
270 // CHECK-PPC64LE-NEXT: [[TMP97:%.*]] = getelementptr inbounds [11 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
271 // CHECK-PPC64LE-NEXT: call void @__tgt_target_data_begin_mapper(ptr @[[GLOB1]], i64 -1, i32 11, ptr [[TMP95]], ptr [[TMP96]], ptr [[TMP97]], ptr @.offload_maptypes.6, ptr null, ptr null)
272 // CHECK-PPC64LE-NEXT: [[TMP98:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
273 // CHECK-PPC64LE-NEXT: [[INC32:%.*]] = add nsw i32 [[TMP98]], 1
274 // CHECK-PPC64LE-NEXT: store i32 [[INC32]], ptr [[ARG_ADDR]], align 4
275 // CHECK-PPC64LE-NEXT: [[TMP99:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 0
276 // CHECK-PPC64LE-NEXT: [[TMP100:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 0
277 // CHECK-PPC64LE-NEXT: [[TMP101:%.*]] = getelementptr inbounds [11 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
278 // CHECK-PPC64LE-NEXT: call void @__tgt_target_data_end_mapper(ptr @[[GLOB1]], i64 -1, i32 11, ptr [[TMP99]], ptr [[TMP100]], ptr [[TMP101]], ptr @.offload_maptypes.6, ptr null, ptr null)
279 // CHECK-PPC64LE-NEXT: ret void
281 // CHECK-I386-LABEL: @_Z3fooi(
282 // CHECK-I386-NEXT: entry:
283 // CHECK-I386-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
284 // CHECK-I386-NEXT: [[LB:%.*]] = alloca [5 x float], align 4
285 // CHECK-I386-NEXT: [[PS1:%.*]] = alloca ptr, align 4
286 // CHECK-I386-NEXT: [[PS2:%.*]] = alloca ptr, align 4
287 // CHECK-I386-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 4
288 // CHECK-I386-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 4
289 // CHECK-I386-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 4
290 // CHECK-I386-NEXT: [[DOTOFFLOAD_BASEPTRS1:%.*]] = alloca [1 x ptr], align 4
291 // CHECK-I386-NEXT: [[DOTOFFLOAD_PTRS2:%.*]] = alloca [1 x ptr], align 4
292 // CHECK-I386-NEXT: [[DOTOFFLOAD_MAPPERS3:%.*]] = alloca [1 x ptr], align 4
293 // CHECK-I386-NEXT: [[DOTOFFLOAD_BASEPTRS5:%.*]] = alloca [1 x ptr], align 4
294 // CHECK-I386-NEXT: [[DOTOFFLOAD_PTRS6:%.*]] = alloca [1 x ptr], align 4
295 // CHECK-I386-NEXT: [[DOTOFFLOAD_MAPPERS7:%.*]] = alloca [1 x ptr], align 4
296 // CHECK-I386-NEXT: [[DOTOFFLOAD_BASEPTRS29:%.*]] = alloca [11 x ptr], align 4
297 // CHECK-I386-NEXT: [[DOTOFFLOAD_PTRS30:%.*]] = alloca [11 x ptr], align 4
298 // CHECK-I386-NEXT: [[DOTOFFLOAD_MAPPERS31:%.*]] = alloca [11 x ptr], align 4
299 // CHECK-I386-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [11 x i64], align 4
300 // CHECK-I386-NEXT: store i32 [[ARG:%.*]], ptr [[ARG_ADDR]], align 4
301 // CHECK-I386-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
302 // CHECK-I386-NEXT: store ptr [[LB]], ptr [[TMP0]], align 4
303 // CHECK-I386-NEXT: [[TMP1:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
304 // CHECK-I386-NEXT: store ptr [[LB]], ptr [[TMP1]], align 4
305 // CHECK-I386-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
306 // CHECK-I386-NEXT: store ptr null, ptr [[TMP2]], align 4
307 // CHECK-I386-NEXT: [[TMP3:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
308 // CHECK-I386-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
309 // CHECK-I386-NEXT: call void @__tgt_target_data_begin_mapper(ptr @[[GLOB1:[0-9]+]], i64 -1, i32 1, ptr [[TMP3]], ptr [[TMP4]], ptr @.offload_sizes, ptr @.offload_maptypes, ptr null, ptr null)
310 // CHECK-I386-NEXT: [[TMP5:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
311 // CHECK-I386-NEXT: [[INC:%.*]] = add nsw i32 [[TMP5]], 1
312 // CHECK-I386-NEXT: store i32 [[INC]], ptr [[ARG_ADDR]], align 4
313 // CHECK-I386-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
314 // CHECK-I386-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
315 // CHECK-I386-NEXT: call void @__tgt_target_data_end_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP6]], ptr [[TMP7]], ptr @.offload_sizes, ptr @.offload_maptypes, ptr null, ptr null)
316 // CHECK-I386-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
317 // CHECK-I386-NEXT: store ptr [[LB]], ptr [[TMP8]], align 4
318 // CHECK-I386-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
319 // CHECK-I386-NEXT: store ptr [[LB]], ptr [[TMP9]], align 4
320 // CHECK-I386-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS3]], i32 0, i32 0
321 // CHECK-I386-NEXT: store ptr null, ptr [[TMP10]], align 4
322 // CHECK-I386-NEXT: [[TMP11:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
323 // CHECK-I386-NEXT: [[TMP12:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
324 // CHECK-I386-NEXT: call void @__tgt_target_data_begin_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP11]], ptr [[TMP12]], ptr @.offload_sizes.1, ptr @.offload_maptypes.2, ptr null, ptr null)
325 // CHECK-I386-NEXT: [[TMP13:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
326 // CHECK-I386-NEXT: [[INC4:%.*]] = add nsw i32 [[TMP13]], 1
327 // CHECK-I386-NEXT: store i32 [[INC4]], ptr [[ARG_ADDR]], align 4
328 // CHECK-I386-NEXT: [[TMP14:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
329 // CHECK-I386-NEXT: [[TMP15:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
330 // CHECK-I386-NEXT: call void @__tgt_target_data_end_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP14]], ptr [[TMP15]], ptr @.offload_sizes.1, ptr @.offload_maptypes.2, ptr null, ptr null)
331 // CHECK-I386-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
332 // CHECK-I386-NEXT: store ptr [[ARG_ADDR]], ptr [[TMP16]], align 4
333 // CHECK-I386-NEXT: [[TMP17:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
334 // CHECK-I386-NEXT: store ptr [[ARG_ADDR]], ptr [[TMP17]], align 4
335 // CHECK-I386-NEXT: [[TMP18:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i32 0, i32 0
336 // CHECK-I386-NEXT: store ptr null, ptr [[TMP18]], align 4
337 // CHECK-I386-NEXT: [[TMP19:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
338 // CHECK-I386-NEXT: [[TMP20:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
339 // CHECK-I386-NEXT: call void @__tgt_target_data_begin_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP19]], ptr [[TMP20]], ptr @.offload_sizes.3, ptr @.offload_maptypes.4, ptr null, ptr null)
340 // CHECK-I386-NEXT: [[TMP21:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
341 // CHECK-I386-NEXT: [[INC8:%.*]] = add nsw i32 [[TMP21]], 1
342 // CHECK-I386-NEXT: store i32 [[INC8]], ptr [[ARG_ADDR]], align 4
343 // CHECK-I386-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
344 // CHECK-I386-NEXT: [[TMP23:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
345 // CHECK-I386-NEXT: call void @__tgt_target_data_end_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP22]], ptr [[TMP23]], ptr @.offload_sizes.3, ptr @.offload_maptypes.4, ptr null, ptr null)
346 // CHECK-I386-NEXT: [[TMP24:%.*]] = load ptr, ptr [[PS1]], align 4
347 // CHECK-I386-NEXT: [[TMP25:%.*]] = load ptr, ptr [[PS1]], align 4
348 // CHECK-I386-NEXT: [[S:%.*]] = getelementptr inbounds [[STRUCT_S2:%.*]], ptr [[TMP25]], i32 0, i32 0
349 // CHECK-I386-NEXT: [[TMP26:%.*]] = load ptr, ptr [[PS1]], align 4
350 // CHECK-I386-NEXT: [[TMP27:%.*]] = load ptr, ptr [[PS1]], align 4
351 // CHECK-I386-NEXT: [[PS:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP27]], i32 0, i32 1
352 // CHECK-I386-NEXT: [[TMP28:%.*]] = load ptr, ptr [[PS1]], align 4
353 // CHECK-I386-NEXT: [[PS9:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP28]], i32 0, i32 1
354 // CHECK-I386-NEXT: [[TMP29:%.*]] = load ptr, ptr [[PS9]], align 4
355 // CHECK-I386-NEXT: [[PS10:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP29]], i32 0, i32 1
356 // CHECK-I386-NEXT: [[TMP30:%.*]] = load ptr, ptr [[PS1]], align 4
357 // CHECK-I386-NEXT: [[PS11:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP30]], i32 0, i32 1
358 // CHECK-I386-NEXT: [[TMP31:%.*]] = load ptr, ptr [[PS11]], align 4
359 // CHECK-I386-NEXT: [[PS12:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP31]], i32 0, i32 1
360 // CHECK-I386-NEXT: [[TMP32:%.*]] = load ptr, ptr [[PS12]], align 4
361 // CHECK-I386-NEXT: [[PS13:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP32]], i32 0, i32 1
362 // CHECK-I386-NEXT: [[TMP33:%.*]] = load ptr, ptr [[PS1]], align 4
363 // CHECK-I386-NEXT: [[PS14:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP33]], i32 0, i32 1
364 // CHECK-I386-NEXT: [[TMP34:%.*]] = load ptr, ptr [[PS14]], align 4
365 // CHECK-I386-NEXT: [[PS15:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP34]], i32 0, i32 1
366 // CHECK-I386-NEXT: [[TMP35:%.*]] = load ptr, ptr [[PS15]], align 4
367 // CHECK-I386-NEXT: [[PS16:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP35]], i32 0, i32 1
368 // CHECK-I386-NEXT: [[TMP36:%.*]] = load ptr, ptr [[PS16]], align 4
369 // CHECK-I386-NEXT: [[S17:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP36]], i32 0, i32 0
370 // CHECK-I386-NEXT: [[TMP37:%.*]] = getelementptr ptr, ptr [[PS]], i32 1
371 // CHECK-I386-NEXT: [[TMP38:%.*]] = ptrtoint ptr [[TMP37]] to i64
372 // CHECK-I386-NEXT: [[TMP39:%.*]] = ptrtoint ptr [[S]] to i64
373 // CHECK-I386-NEXT: [[TMP40:%.*]] = sub i64 [[TMP38]], [[TMP39]]
374 // CHECK-I386-NEXT: [[TMP41:%.*]] = sdiv exact i64 [[TMP40]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
375 // CHECK-I386-NEXT: [[TMP42:%.*]] = load ptr, ptr [[PS2]], align 4
376 // CHECK-I386-NEXT: [[TMP43:%.*]] = load ptr, ptr [[PS2]], align 4
377 // CHECK-I386-NEXT: [[S18:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP43]], i32 0, i32 0
378 // CHECK-I386-NEXT: [[TMP44:%.*]] = load ptr, ptr [[PS2]], align 4
379 // CHECK-I386-NEXT: [[TMP45:%.*]] = load ptr, ptr [[PS2]], align 4
380 // CHECK-I386-NEXT: [[PS19:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP45]], i32 0, i32 1
381 // CHECK-I386-NEXT: [[TMP46:%.*]] = load ptr, ptr [[PS2]], align 4
382 // CHECK-I386-NEXT: [[PS20:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP46]], i32 0, i32 1
383 // CHECK-I386-NEXT: [[TMP47:%.*]] = load ptr, ptr [[PS20]], align 4
384 // CHECK-I386-NEXT: [[PS21:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP47]], i32 0, i32 1
385 // CHECK-I386-NEXT: [[TMP48:%.*]] = load ptr, ptr [[PS2]], align 4
386 // CHECK-I386-NEXT: [[PS22:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP48]], i32 0, i32 1
387 // CHECK-I386-NEXT: [[TMP49:%.*]] = load ptr, ptr [[PS22]], align 4
388 // CHECK-I386-NEXT: [[PS23:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP49]], i32 0, i32 1
389 // CHECK-I386-NEXT: [[TMP50:%.*]] = load ptr, ptr [[PS23]], align 4
390 // CHECK-I386-NEXT: [[PS24:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP50]], i32 0, i32 1
391 // CHECK-I386-NEXT: [[TMP51:%.*]] = load ptr, ptr [[PS2]], align 4
392 // CHECK-I386-NEXT: [[PS25:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP51]], i32 0, i32 1
393 // CHECK-I386-NEXT: [[TMP52:%.*]] = load ptr, ptr [[PS25]], align 4
394 // CHECK-I386-NEXT: [[PS26:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP52]], i32 0, i32 1
395 // CHECK-I386-NEXT: [[TMP53:%.*]] = load ptr, ptr [[PS26]], align 4
396 // CHECK-I386-NEXT: [[PS27:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP53]], i32 0, i32 1
397 // CHECK-I386-NEXT: [[TMP54:%.*]] = load ptr, ptr [[PS27]], align 4
398 // CHECK-I386-NEXT: [[S28:%.*]] = getelementptr inbounds [[STRUCT_S2]], ptr [[TMP54]], i32 0, i32 0
399 // CHECK-I386-NEXT: [[TMP55:%.*]] = getelementptr ptr, ptr [[PS19]], i32 1
400 // CHECK-I386-NEXT: [[TMP56:%.*]] = ptrtoint ptr [[TMP55]] to i64
401 // CHECK-I386-NEXT: [[TMP57:%.*]] = ptrtoint ptr [[S18]] to i64
402 // CHECK-I386-NEXT: [[TMP58:%.*]] = sub i64 [[TMP56]], [[TMP57]]
403 // CHECK-I386-NEXT: [[TMP59:%.*]] = sdiv exact i64 [[TMP58]], ptrtoint (ptr getelementptr (i8, ptr null, i32 1) to i64)
404 // CHECK-I386-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes.5, i32 88, i1 false)
405 // CHECK-I386-NEXT: [[TMP60:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 0
406 // CHECK-I386-NEXT: store ptr [[TMP24]], ptr [[TMP60]], align 4
407 // CHECK-I386-NEXT: [[TMP61:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 0
408 // CHECK-I386-NEXT: store ptr [[S]], ptr [[TMP61]], align 4
409 // CHECK-I386-NEXT: [[TMP62:%.*]] = getelementptr inbounds [11 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
410 // CHECK-I386-NEXT: store i64 [[TMP41]], ptr [[TMP62]], align 4
411 // CHECK-I386-NEXT: [[TMP63:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 0
412 // CHECK-I386-NEXT: store ptr null, ptr [[TMP63]], align 4
413 // CHECK-I386-NEXT: [[TMP64:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 1
414 // CHECK-I386-NEXT: store ptr [[TMP24]], ptr [[TMP64]], align 4
415 // CHECK-I386-NEXT: [[TMP65:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 1
416 // CHECK-I386-NEXT: store ptr [[S]], ptr [[TMP65]], align 4
417 // CHECK-I386-NEXT: [[TMP66:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 1
418 // CHECK-I386-NEXT: store ptr null, ptr [[TMP66]], align 4
419 // CHECK-I386-NEXT: [[TMP67:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 2
420 // CHECK-I386-NEXT: store ptr [[PS]], ptr [[TMP67]], align 4
421 // CHECK-I386-NEXT: [[TMP68:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 2
422 // CHECK-I386-NEXT: store ptr [[PS10]], ptr [[TMP68]], align 4
423 // CHECK-I386-NEXT: [[TMP69:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 2
424 // CHECK-I386-NEXT: store ptr null, ptr [[TMP69]], align 4
425 // CHECK-I386-NEXT: [[TMP70:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 3
426 // CHECK-I386-NEXT: store ptr [[PS10]], ptr [[TMP70]], align 4
427 // CHECK-I386-NEXT: [[TMP71:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 3
428 // CHECK-I386-NEXT: store ptr [[PS13]], ptr [[TMP71]], align 4
429 // CHECK-I386-NEXT: [[TMP72:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 3
430 // CHECK-I386-NEXT: store ptr null, ptr [[TMP72]], align 4
431 // CHECK-I386-NEXT: [[TMP73:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 4
432 // CHECK-I386-NEXT: store ptr [[PS13]], ptr [[TMP73]], align 4
433 // CHECK-I386-NEXT: [[TMP74:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 4
434 // CHECK-I386-NEXT: store ptr [[S17]], ptr [[TMP74]], align 4
435 // CHECK-I386-NEXT: [[TMP75:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 4
436 // CHECK-I386-NEXT: store ptr null, ptr [[TMP75]], align 4
437 // CHECK-I386-NEXT: [[TMP76:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 5
438 // CHECK-I386-NEXT: store ptr [[ARG_ADDR]], ptr [[TMP76]], align 4
439 // CHECK-I386-NEXT: [[TMP77:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 5
440 // CHECK-I386-NEXT: store ptr [[ARG_ADDR]], ptr [[TMP77]], align 4
441 // CHECK-I386-NEXT: [[TMP78:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 5
442 // CHECK-I386-NEXT: store ptr null, ptr [[TMP78]], align 4
443 // CHECK-I386-NEXT: [[TMP79:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 6
444 // CHECK-I386-NEXT: store ptr [[TMP42]], ptr [[TMP79]], align 4
445 // CHECK-I386-NEXT: [[TMP80:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 6
446 // CHECK-I386-NEXT: store ptr [[S18]], ptr [[TMP80]], align 4
447 // CHECK-I386-NEXT: [[TMP81:%.*]] = getelementptr inbounds [11 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 6
448 // CHECK-I386-NEXT: store i64 [[TMP59]], ptr [[TMP81]], align 4
449 // CHECK-I386-NEXT: [[TMP82:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 6
450 // CHECK-I386-NEXT: store ptr null, ptr [[TMP82]], align 4
451 // CHECK-I386-NEXT: [[TMP83:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 7
452 // CHECK-I386-NEXT: store ptr [[TMP42]], ptr [[TMP83]], align 4
453 // CHECK-I386-NEXT: [[TMP84:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 7
454 // CHECK-I386-NEXT: store ptr [[S18]], ptr [[TMP84]], align 4
455 // CHECK-I386-NEXT: [[TMP85:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 7
456 // CHECK-I386-NEXT: store ptr null, ptr [[TMP85]], align 4
457 // CHECK-I386-NEXT: [[TMP86:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 8
458 // CHECK-I386-NEXT: store ptr [[PS19]], ptr [[TMP86]], align 4
459 // CHECK-I386-NEXT: [[TMP87:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 8
460 // CHECK-I386-NEXT: store ptr [[PS21]], ptr [[TMP87]], align 4
461 // CHECK-I386-NEXT: [[TMP88:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 8
462 // CHECK-I386-NEXT: store ptr null, ptr [[TMP88]], align 4
463 // CHECK-I386-NEXT: [[TMP89:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 9
464 // CHECK-I386-NEXT: store ptr [[PS21]], ptr [[TMP89]], align 4
465 // CHECK-I386-NEXT: [[TMP90:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 9
466 // CHECK-I386-NEXT: store ptr [[PS24]], ptr [[TMP90]], align 4
467 // CHECK-I386-NEXT: [[TMP91:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 9
468 // CHECK-I386-NEXT: store ptr null, ptr [[TMP91]], align 4
469 // CHECK-I386-NEXT: [[TMP92:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 10
470 // CHECK-I386-NEXT: store ptr [[PS24]], ptr [[TMP92]], align 4
471 // CHECK-I386-NEXT: [[TMP93:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 10
472 // CHECK-I386-NEXT: store ptr [[S28]], ptr [[TMP93]], align 4
473 // CHECK-I386-NEXT: [[TMP94:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_MAPPERS31]], i32 0, i32 10
474 // CHECK-I386-NEXT: store ptr null, ptr [[TMP94]], align 4
475 // CHECK-I386-NEXT: [[TMP95:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 0
476 // CHECK-I386-NEXT: [[TMP96:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 0
477 // CHECK-I386-NEXT: [[TMP97:%.*]] = getelementptr inbounds [11 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
478 // CHECK-I386-NEXT: call void @__tgt_target_data_begin_mapper(ptr @[[GLOB1]], i64 -1, i32 11, ptr [[TMP95]], ptr [[TMP96]], ptr [[TMP97]], ptr @.offload_maptypes.6, ptr null, ptr null)
479 // CHECK-I386-NEXT: [[TMP98:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
480 // CHECK-I386-NEXT: [[INC32:%.*]] = add nsw i32 [[TMP98]], 1
481 // CHECK-I386-NEXT: store i32 [[INC32]], ptr [[ARG_ADDR]], align 4
482 // CHECK-I386-NEXT: [[TMP99:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_BASEPTRS29]], i32 0, i32 0
483 // CHECK-I386-NEXT: [[TMP100:%.*]] = getelementptr inbounds [11 x ptr], ptr [[DOTOFFLOAD_PTRS30]], i32 0, i32 0
484 // CHECK-I386-NEXT: [[TMP101:%.*]] = getelementptr inbounds [11 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
485 // CHECK-I386-NEXT: call void @__tgt_target_data_end_mapper(ptr @[[GLOB1]], i64 -1, i32 11, ptr [[TMP99]], ptr [[TMP100]], ptr [[TMP101]], ptr @.offload_maptypes.6, ptr null, ptr null)
486 // CHECK-I386-NEXT: ret void
488 void foo(int arg) {
489 float lb[5];
490 S2 *ps1;
491 S2 *ps2;
493 #pragma omp target data map(ompx_hold, to: lb)
494 {++arg;}
496 #pragma omp target data map(always close ompx_hold, to: lb)
497 {++arg;}
499 #pragma omp target data map(ompx_hold, tofrom : arg)
500 {++arg;}
502 // Make sure the struct picks up ompx_hold even if another element of the
503 // struct doesn't have ompx_hold.
504 #pragma omp target data map(tofrom : ps1->s, arg) \
505 map(ompx_hold, tofrom : ps1->ps->ps->ps->s, ps2->s) \
506 map(tofrom : ps2->ps->ps->ps->s)
508 ++(arg);
512 #endif