275 lines · cpp
1// Test host codegen.2// RUN: %clang_cc1 -verify -Wno-vla -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-64 --check-prefix OMP50 --check-prefix OMP50-643// RUN: %clang_cc1 -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 CHECK --check-prefix CHECK-64 --check-prefix OMP454// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s5// RUN: %clang_cc1 -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 CHECK --check-prefix CHECK-64 --check-prefix OMP50 --check-prefix OMP50-646// RUN: %clang_cc1 -verify -Wno-vla -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix CHECK --check-prefix CHECK-32 --check-prefix OMP50 --check-prefix OMP50-327// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s8// RUN: %clang_cc1 -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 CHECK --check-prefix CHECK-32 --check-prefix OMP50 --check-prefix OMP50-329 10 11// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s12// RUN: %clang_cc1 -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 CHECK --check-prefix CHECK-64 --check-prefix OMP4513// RUN: %clang_cc1 -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 CHECK --check-prefix CHECK-32 --check-prefix OMP4514// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s15// RUN: %clang_cc1 -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 CHECK --check-prefix CHECK-32 --check-prefix OMP4516 17 18// RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s19// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s20// RUN: %clang_cc1 -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 --check-prefix SIMD-ONLY0 %s21// RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck --check-prefix SIMD-ONLY0 %s22// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s23// RUN: %clang_cc1 -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 --check-prefix SIMD-ONLY0 %s24// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}25 26// Test target codegen - host bc file has to be created first.27// RUN: %clang_cc1 -verify -Wno-vla -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc28// RUN: %clang_cc1 -verify -Wno-vla -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-6429// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s30// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-6431// RUN: %clang_cc1 -verify -Wno-vla -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc32// RUN: %clang_cc1 -verify -Wno-vla -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-3233// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s34// RUN: %clang_cc1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-3235 36// RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc37// RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s38// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s39// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s40// RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc41// RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck --check-prefix SIMD-ONLY1 %s42// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s43// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck --check-prefix SIMD-ONLY1 %s44// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}45 46// expected-no-diagnostics47#ifndef HEADER48#define HEADER49 50// CHECK-DAG: [[TT:%.+]] = type { i64, i8 }51// CHECK-DAG: [[ENTTY:%.+]] = type { i64, i16, i16, i32, ptr, ptr, i64, i64, ptr }52 53// TCHECK: [[ENTTY:%.+]] = type { i64, i16, i16, i32, ptr, ptr, i64, i64, ptr }54 55// OMP45-DAG: [[SIZET:@.+]] = private unnamed_addr constant [2 x i64] [i64 0, i64 4]56// OMP45-DAG: [[MAPT:@.+]] = private unnamed_addr constant [2 x i64] [i64 544, i64 800]57// OMP45-DAG: @{{.*}} = weak constant i8 058 59// OMP50-DAG: [[SIZET:@.+]] = private unnamed_addr constant [3 x i64] [i64 0, i64 4, i64 1]60// OMP50-DAG: [[MAPT:@.+]] = private unnamed_addr constant [3 x i64] [i64 544, i64 800, i64 800]61// OMP50-DAG: @{{.*}} = weak constant i8 062 63 64// TCHECK: @{{.+}} = weak constant [[ENTTY]]65// TCHECK: @{{.+}} = {{.*}}constant [[ENTTY]]66// TCHECK-NOT: @{{.+}} = weak constant [[ENTTY]]67 68template<typename tx, typename ty>69struct TT{70 tx X;71 ty Y;72};73 74int global;75extern int global;76 77// CHECK: define {{.*}}[[FOO:@.+]](78int foo(int n) {79 int a = 0;80 short aa = 0;81 float b[10];82 float bn[n];83 double c[5][10];84 double cn[5][n];85 TT<long long, char> d;86 static long *plocal;87 88 // CHECK: [[ADD:%.+]] = add nsw i3289 // CHECK: store i32 [[ADD]], ptr [[DEVICE_CAP:%.+]],90 // CHECK: [[GEP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 091 // CHECK: [[DEV:%.+]] = load i32, ptr [[DEVICE_CAP]],92 // CHECK: store i32 [[DEV]], ptr [[GEP]],93 // CHECK: [[TASK:%.+]] = call ptr @__kmpc_omp_task_alloc(ptr [[ID:@.+]], i32 [[GTID:%.+]], i32 1, i[[SZ:32|64]] {{20|40}}, i[[SZ]] 4, ptr [[TASK_ENTRY0:@.+]])94 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 095 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 196 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 297 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 398 // CHECK: call void @__kmpc_omp_taskwait_deps_51(ptr [[ID]], i32 [[GTID]], i32 4, ptr %{{.+}}, i32 0, ptr null, i32 0)99 // CHECK: call void @__kmpc_omp_task_begin_if0(ptr [[ID]], i32 [[GTID]], ptr [[TASK]])100 // CHECK: call i32 [[TASK_ENTRY0]](i32 [[GTID]], ptr [[TASK]])101 // CHECK: call void @__kmpc_omp_task_complete_if0(ptr [[ID]], i32 [[GTID]], ptr [[TASK]])102 #pragma omp target teams distribute simd device(global + a) depend(in: global) depend(out: a, b, cn[4])103 for (int i = 0; i < 10; ++i) {104 }105 106 // CHECK: [[ADD:%.+]] = add nsw i32107 // CHECK: store i32 [[ADD]], ptr [[DEVICE_CAP:%.+]],108 109 // OMP45: [[BOOL:%.+]] = icmp ne i32 %{{.+}}, 0110 // OMP45: br i1 [[BOOL]], label %[[THEN:.+]], label %[[ELSE:.+]]111 // OMP50: br i1 {{.+}}, label %[[THEN:.+]], label %[[ELSE:.+]]112 // CHECK: [[THEN]]:113 // OMP45-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [2 x ptr], ptr [[BP:%.+]], i32 0, i32 0114 // OMP45-DAG: [[PADDR0:%.+]] = getelementptr inbounds [2 x ptr], ptr [[P:%.+]], i32 0, i32 0115 // OMP50-DAG: [[BPADDR0:%.+]] = getelementptr inbounds [3 x ptr], ptr [[BP:%.+]], i32 0, i32 0116 // OMP50-DAG: [[PADDR0:%.+]] = getelementptr inbounds [3 x ptr], ptr [[P:%.+]], i32 0, i32 0117 // CHECK-DAG: store ptr [[BP0:%[^,]+]], ptr [[BPADDR0]]118 // CHECK-DAG: store ptr [[BP0]], ptr [[PADDR0]]119 120 // OMP45-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [2 x ptr], ptr [[BP]], i32 0, i32 1121 // OMP45-DAG: [[PADDR1:%.+]] = getelementptr inbounds [2 x ptr], ptr [[P]], i32 0, i32 1122 123 // OMP50-DAG: [[BPADDR1:%.+]] = getelementptr inbounds [3 x ptr], ptr [[BP]], i32 0, i32 1124 // OMP50-DAG: [[PADDR1:%.+]] = getelementptr inbounds [3 x ptr], ptr [[P]], i32 0, i32 1125 // CHECK-DAG: store i[[SZ]] [[BP1:%[^,]+]], ptr [[BPADDR1]]126 // CHECK-DAG: store i[[SZ]] [[BP1]], ptr [[PADDR1]]127 128 // OMP50-DAG: [[BPADDR2:%.+]] = getelementptr inbounds [3 x ptr], ptr [[BP]], i32 0, i32 2129 // OMP50-DAG: [[PADDR2:%.+]] = getelementptr inbounds [3 x ptr], ptr [[P]], i32 0, i32 2130 // OMP50-DAG: store i[[SZ]] [[BP2:%[^,]+]], ptr [[BPADDR2]]131 // OMP50-DAG: store i[[SZ]] [[BP2]], ptr [[PADDR2]]132 133 134 // OMP45-DAG: getelementptr inbounds [2 x ptr], ptr [[BP]], i32 0, i32 0135 // OMP45-DAG: getelementptr inbounds [2 x ptr], ptr [[P]], i32 0, i32 0136 // OMP50-DAG: getelementptr inbounds [3 x ptr], ptr [[BP]], i32 0, i32 0137 // OMP50-DAG: getelementptr inbounds [3 x ptr], ptr [[P]], i32 0, i32 0138 139 // OMP45: [[GEP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 2140 // OMP50-64: [[GEP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 4141 // OMP50-32: [[GEP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 3142 // CHECK: [[DEV:%.+]] = load i32, ptr [[DEVICE_CAP]],143 // CHECK: store i32 [[DEV]], ptr [[GEP]],144 // CHECK: [[DEV1:%.+]] = load i32, ptr [[DEVICE_CAP]],145 // CHECK: [[DEV2:%.+]] = sext i32 [[DEV1]] to i64146 147 // OMP45: [[TASK:%.+]] = call ptr @__kmpc_omp_target_task_alloc(ptr [[ID]], i32 [[GTID]], i32 1, i[[SZ]] {{104|60}}, i[[SZ]] {{16|12}}, ptr [[TASK_ENTRY1_:@.+]], i64 [[DEV2]])148 // OMP50: [[TASK:%.+]] = call ptr @__kmpc_omp_target_task_alloc(ptr [[ID]], i32 [[GTID]], i32 1, i[[SZ]] {{28|128|76}}, i[[SZ]] {{16|12|24}}, ptr [[TASK_ENTRY1_:@.+]], i64 [[DEV2]])149 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 0150 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 1151 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 2152 // CHECK: call i32 @__kmpc_omp_task_with_deps(ptr [[ID]], i32 [[GTID]], ptr [[TASK]], i32 3, ptr %{{.+}}, i32 0, ptr null)153 // CHECK: br label %[[EXIT:.+]]154 155 // CHECK: [[ELSE]]:156 // OMP45-NOT: getelementptr inbounds [2 x ptr], ptr157 // OMP50-NOT: getelementptr inbounds [3 x ptr], ptr158 // OMP45: [[GEP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 2159 // OMP50-64: [[GEP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 4160 // OMP50-32: [[GEP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 3161 // CHECK: [[DEV:%.+]] = load i32, ptr [[DEVICE_CAP]],162 // CHECK: store i32 [[DEV]], ptr [[GEP]],163 // CHECK: [[DEV1:%.+]] = load i32, ptr [[DEVICE_CAP]],164 // CHECK: [[DEV2:%.+]] = sext i32 [[DEV1]] to i64165 166 // OMP45: [[TASK:%.+]] = call ptr @__kmpc_omp_target_task_alloc(ptr [[ID]], i32 [[GTID]], i32 1, i[[SZ]] {{56|28}}, i[[SZ]] {{16|12}}, ptr [[TASK_ENTRY1__:@.+]], i64 [[DEV2]])167 // OMP50: [[TASK:%.+]] = call ptr @__kmpc_omp_target_task_alloc(ptr [[ID]], i32 [[GTID]], i32 1, i[[SZ]] {{56|28}}, i[[SZ]] {{16|12|24}}, ptr [[TASK_ENTRY1__:@.+]], i64 [[DEV2]])168 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 0169 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 1170 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 2171 // CHECK: call i32 @__kmpc_omp_task_with_deps(ptr [[ID]], i32 [[GTID]], ptr [[TASK]], i32 3, ptr %{{.+}}, i32 0, ptr null)172 // CHECK: br label %[[EXIT:.+]]173 // CHECK: [[EXIT]]:174 175 #pragma omp target teams distribute simd device(global + a) nowait depend(inout: global, a, bn) if(a)176 for (int i = 0; i < *plocal; ++i) {177 static int local1;178 *plocal = global;179 local1 = global;180 }181 182 // CHECK: [[TASK:%.+]] = call ptr @__kmpc_omp_task_alloc(ptr [[ID]], i32 [[GTID]], i32 1, i[[SZ]] {{48|24}}, i[[SZ]] 4, ptr [[TASK_ENTRY2:@.+]])183 // CHECK: getelementptr %struct.kmp_depend_info, ptr %{{.+}}, i[[SZ]] 0184 // CHECK: call void @__kmpc_omp_taskwait_deps_51(ptr [[ID]], i32 [[GTID]], i32 1, ptr %{{.+}}, i32 0, ptr null, i32 0)185 // CHECK: call void @__kmpc_omp_task_begin_if0(ptr [[ID]], i32 [[GTID]], ptr [[TASK]])186 // CHECK: call i32 [[TASK_ENTRY2]](i32 [[GTID]], ptr [[TASK]])187 // CHECK: call void @__kmpc_omp_task_complete_if0(ptr [[ID]], i32 [[GTID]], ptr [[TASK]])188 #pragma omp target teams distribute simd if(0) firstprivate(global) depend(out:global)189 for (int i = 0; i < global; ++i) {190 global += 1;191 }192 193 return a;194}195 196// Check that the offloading functions are emitted and that the arguments are197// correct and loaded correctly for the target regions in foo().198 199// CHECK: define internal void [[HVT0:@.+]]()200 201// CHECK: define internal{{.*}} i32 [[TASK_ENTRY0]](i32{{.*}}, ptr noalias noundef %1)202// CHECK: store ptr null, ptr %203// CHECK: [[DEVICE_CAP:%.+]] = load ptr,204// CHECK: [[DEV:%.+]] = load i32, ptr [[DEVICE_CAP]],205// CHECK: [[DEVICE:%.+]] = sext i32 [[DEV]] to i64206// CHECK: [[RET:%.+]] = call i32 @__tgt_target_kernel(ptr @{{.+}}, i64 [[DEVICE]], i32 0, i32 1, ptr @.{{.+}}.region_id, ptr %{{.+}})207// CHECK-NEXT: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0208// CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]]209// CHECK: [[FAIL]]210// CHECK: call void [[HVT0]]()211// CHECK-NEXT: br label %[[END]]212// CHECK: [[END]]213// CHECK: ret i32 0214 215// CHECK: define internal void [[HVT1:@.+]](ptr noundef %{{.+}}, i[[SZ]] noundef %{{.+}})216 217// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1_]](i32{{.*}}, ptr noalias noundef %1)218// CHECK: call void {{%.*}}(219// OMP45: [[DEVICE_CAP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 2220// OMP50-64: [[DEVICE_CAP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 4221// OMP50-32: [[DEVICE_CAP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 3222// CHECK: [[DEV:%.+]] = load i32, ptr [[DEVICE_CAP]],223// CHECK: [[DEVICE:%.+]] = sext i32 [[DEV]] to i64224// OMP45: [[RET:%.+]] = call i32 @__tgt_target_kernel(ptr @{{.+}}, i64 [[DEVICE]], i32 0, i32 1, ptr @.{{.+}}.region_id, ptr %{{.+}})225// OMP50: [[RET:%.+]] = call i32 @__tgt_target_kernel(ptr @{{.+}}, i64 [[DEVICE]], i32 0, i32 1, ptr @.{{.+}}.region_id, ptr %{{.+}})226 227// CHECK: [[ERROR:%.+]] = icmp ne i32 [[RET]], 0228// CHECK-NEXT: br i1 [[ERROR]], label %[[FAIL:[^,]+]], label %[[END:[^,]+]]229// CHECK: [[FAIL]]230// CHECK: [[BP0:%.+]] = load ptr, ptr %231// CHECK: [[BP1_I32:%.+]] = load i32, ptr @232// CHECK-64: store i32 [[BP1_I32]], ptr [[BP1_PTR:%[^,]+]],233// CHECK-32: store i32 [[BP1_I32]], ptr [[BP1_PTR:%[^,]+]],234// CHECK: [[BP1:%.+]] = load i[[SZ]], ptr [[BP1_PTR]],235// OMP45: call void [[HVT1]](ptr [[BP0]], i[[SZ]] [[BP1]])236 237// OMP50: [[BP2:%.+]] = load i[[SZ]], ptr238// OMP50: call void [[HVT1]](ptr [[BP0]], i[[SZ]] [[BP1]], i[[SZ]] [[BP2]])239// CHECK-NEXT: br label %[[END]]240// CHECK: [[END]]241// CHECK: ret i32 0242 243// CHECK: define internal{{.*}} i32 [[TASK_ENTRY1__]](i32{{.*}}, ptr noalias noundef %1)244// CHECK: call void {{%.*}}(245// CHECK: [[DEVICE_CAP:%.+]] = getelementptr inbounds nuw %{{.+}}, ptr %{{.+}}, i32 0, i32 2246// CHECK: [[BP0:%.+]] = load ptr, ptr %247// CHECK: [[BP1_I32:%.+]] = load i32, ptr @248// CHECK-64: store i32 [[BP1_I32]], ptr [[BP1_PTR:%[^,]+]],249// CHECK-32: store i32 [[BP1_I32]], ptr [[BP1_PTR:%[^,]+]],250// CHECK: [[BP1:%.+]] = load i[[SZ]], ptr [[BP1_PTR]],251// OMP50: [[BP2:%.+]] = load i[[SZ]], ptr252// OMP45: call void [[HVT1]](ptr [[BP0]], i[[SZ]] [[BP1]])253// OMP50: call void [[HVT1]](ptr [[BP0]], i[[SZ]] [[BP1]], i[[SZ]] [[BP2]])254 255// CHECK: ret i32 0256 257// CHECK: define internal void [[HVT2:@.+]](i[[SZ]] noundef %{{.+}})258// Create stack storage and store argument in there.259// CHECK: [[AA_ADDR:%.+]] = alloca i[[SZ]], align260// CHECK: store i[[SZ]] %{{.+}}, ptr [[AA_ADDR]], align261// CHECK-64: load i32, ptr [[AA_ADDR]], align262// CHECK-32: load i32, ptr [[AA_ADDR]], align263 264// CHECK: define internal{{.*}} i32 [[TASK_ENTRY2]](i32{{.*}}, ptr noalias noundef %1)265// CHECK: call void {{%.*}}(266// CHECK: [[BP1_I32:%.+]] = load i32, ptr %267// CHECK-64: store i32 [[BP1_I32]], ptr [[BP1_PTR:%[^,]+]],268// CHECK-32: store i32 [[BP1_I32]], ptr [[BP1_PTR:%[^,]+]],269// CHECK: [[BP1:%.+]] = load i[[SZ]], ptr [[BP1_PTR]],270// CHECK: call void [[HVT2]](i[[SZ]] [[BP1]])271// CHECK: ret i32 0272 273 274#endif275