| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals |
| ; RUN: opt -S -passes=openmp-opt < %s | FileCheck %s --check-prefixes=CHECK |
| ; RUN: opt -S -passes=openmp-opt -openmp-opt-disable-spmdization < %s | FileCheck %s --check-prefixes=CHECK-DISABLE-SPMDIZATION |
| ; |
| ; int G; |
| ; |
| ; void leaf() { |
| ; G = 42; |
| ; } |
| ; |
| ; void spmd_helper() { |
| ; leaf(); |
| ; #pragma omp parallel |
| ; unknown(); |
| ; } |
| ; void spmd() { |
| ; #pragma omp target |
| ; spmd_helper(); |
| ; } |
| ; |
| ; void generic_helper() { |
| ; leaf(); |
| ; } |
| ; void generic() { |
| ; #pragma omp target |
| ; generic_helper(); |
| ; } |
| ; |
| target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64" |
| target triple = "nvptx64" |
| |
| %struct.ident_t = type { i32, i32, i32, i32, ptr } |
| %struct.ConfigurationEnvironmentTy = type { i8, i8, i8 } |
| %struct.KernelEnvironmentTy = type { %struct.ConfigurationEnvironmentTy, ptr, ptr } |
| |
| @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 |
| @1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 0, ptr @0 }, align 8 |
| @2 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 2, i32 0, ptr @0 }, align 8 |
| @G = external global i32, align 4 |
| @__omp_offloading_2b_10393b5_spmd_l12_kernel_environment = local_unnamed_addr constant %struct.KernelEnvironmentTy { %struct.ConfigurationEnvironmentTy { i8 0, i8 0, i8 1 }, ptr @1, ptr null } |
| @__omp_offloading_2b_10393b5_generic_l20_kernel_environment = local_unnamed_addr constant %struct.KernelEnvironmentTy { %struct.ConfigurationEnvironmentTy { i8 0, i8 0, i8 1 }, ptr @1, ptr null } |
| |
| ;. |
| ; CHECK: @[[GLOB0:[0-9]+]] = private unnamed_addr constant [23 x i8] c" |
| ; CHECK: @[[GLOB1:[0-9]+]] = private unnamed_addr constant [[STRUCT_IDENT_T:%.*]] { i32 0, i32 2, i32 0, i32 0, ptr @[[GLOB0]] }, align 8 |
| ; CHECK: @[[GLOB2:[0-9]+]] = private unnamed_addr constant [[STRUCT_IDENT_T:%.*]] { i32 0, i32 2, i32 2, i32 0, ptr @[[GLOB0]] }, align 8 |
| ; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external global i32, align 4 |
| ; CHECK: @[[__OMP_OFFLOADING_2B_10393B5_SPMD_L12_KERNEL_ENVIRONMENT:[a-zA-Z0-9_$"\\.-]+]] = local_unnamed_addr constant [[STRUCT_KERNELENVIRONMENTTY:%.*]] { [[STRUCT_CONFIGURATIONENVIRONMENTTY:%.*]] { i8 0, i8 1, i8 3 }, ptr @[[GLOB1]], ptr null } |
| ; CHECK: @[[__OMP_OFFLOADING_2B_10393B5_GENERIC_L20_KERNEL_ENVIRONMENT:[a-zA-Z0-9_$"\\.-]+]] = local_unnamed_addr constant [[STRUCT_KERNELENVIRONMENTTY:%.*]] { [[STRUCT_CONFIGURATIONENVIRONMENTTY:%.*]] { i8 0, i8 0, i8 3 }, ptr @[[GLOB1]], ptr null } |
| ; CHECK: @[[GLOB3:[0-9]+]] = private unnamed_addr constant [[STRUCT_IDENT_T:%.*]] { i32 0, i32 2, i32 0, i32 22, ptr @[[GLOB0]] }, align 8 |
| ;. |
| ; CHECK-DISABLE-SPMDIZATION: @[[GLOB0:[0-9]+]] = private unnamed_addr constant [23 x i8] c" |
| ; CHECK-DISABLE-SPMDIZATION: @[[GLOB1:[0-9]+]] = private unnamed_addr constant [[STRUCT_IDENT_T:%.*]] { i32 0, i32 2, i32 0, i32 0, ptr @[[GLOB0]] }, align 8 |
| ; CHECK-DISABLE-SPMDIZATION: @[[GLOB2:[0-9]+]] = private unnamed_addr constant [[STRUCT_IDENT_T:%.*]] { i32 0, i32 2, i32 2, i32 0, ptr @[[GLOB0]] }, align 8 |
| ; CHECK-DISABLE-SPMDIZATION: @[[G:[a-zA-Z0-9_$"\\.-]+]] = external global i32, align 4 |
| ; CHECK-DISABLE-SPMDIZATION: @[[__OMP_OFFLOADING_2B_10393B5_SPMD_L12_KERNEL_ENVIRONMENT:[a-zA-Z0-9_$"\\.-]+]] = local_unnamed_addr constant [[STRUCT_KERNELENVIRONMENTTY:%.*]] { [[STRUCT_CONFIGURATIONENVIRONMENTTY:%.*]] { i8 0, i8 1, i8 1 }, ptr @[[GLOB1]], ptr null } |
| ; CHECK-DISABLE-SPMDIZATION: @[[__OMP_OFFLOADING_2B_10393B5_GENERIC_L20_KERNEL_ENVIRONMENT:[a-zA-Z0-9_$"\\.-]+]] = local_unnamed_addr constant [[STRUCT_KERNELENVIRONMENTTY:%.*]] { [[STRUCT_CONFIGURATIONENVIRONMENTTY:%.*]] { i8 0, i8 0, i8 1 }, ptr @[[GLOB1]], ptr null } |
| ;. |
| define weak void @__omp_offloading_2b_10393b5_spmd_l12() "kernel" #0 { |
| ; CHECK-LABEL: define {{[^@]+}}@__omp_offloading_2b_10393b5_spmd_l12 |
| ; CHECK-SAME: () #[[ATTR0:[0-9]+]] { |
| ; CHECK-NEXT: entry: |
| ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @__omp_offloading_2b_10393b5_spmd_l12_kernel_environment) |
| ; CHECK-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 |
| ; CHECK-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] |
| ; CHECK: user_code.entry: |
| ; CHECK-NEXT: call void @spmd_helper() #[[ATTR6:[0-9]+]] |
| ; CHECK-NEXT: call void @__kmpc_target_deinit() |
| ; CHECK-NEXT: ret void |
| ; CHECK: worker.exit: |
| ; CHECK-NEXT: ret void |
| ; |
| ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@__omp_offloading_2b_10393b5_spmd_l12 |
| ; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR0:[0-9]+]] { |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @__omp_offloading_2b_10393b5_spmd_l12_kernel_environment) |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] |
| ; CHECK-DISABLE-SPMDIZATION: user_code.entry: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @spmd_helper() #[[ATTR6:[0-9]+]] |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__kmpc_target_deinit() |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void |
| ; CHECK-DISABLE-SPMDIZATION: worker.exit: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void |
| ; |
| entry: |
| %0 = call i32 @__kmpc_target_init(ptr @__omp_offloading_2b_10393b5_spmd_l12_kernel_environment) |
| %exec_user_code = icmp eq i32 %0, -1 |
| br i1 %exec_user_code, label %user_code.entry, label %worker.exit |
| |
| user_code.entry: ; preds = %entry |
| call void @spmd_helper() #5 |
| call void @__kmpc_target_deinit() |
| ret void |
| |
| worker.exit: ; preds = %entry |
| ret void |
| } |
| |
| ; Make it a weak definition so we will apply custom state machine rewriting but can't use the body in the reasoning. |
| define weak i32 @__kmpc_target_init(ptr) { |
| ; CHECK-LABEL: define {{[^@]+}}@__kmpc_target_init |
| ; CHECK-SAME: (ptr [[TMP0:%.*]]) { |
| ; CHECK-NEXT: ret i32 0 |
| ; |
| ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@__kmpc_target_init |
| ; CHECK-DISABLE-SPMDIZATION-SAME: (ptr [[TMP0:%.*]]) { |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret i32 0 |
| ; |
| ret i32 0 |
| } |
| |
| declare void @__kmpc_target_deinit() |
| |
| ; Function Attrs: convergent noinline norecurse nounwind |
| define weak void @__omp_offloading_2b_10393b5_generic_l20() #0 { |
| ; CHECK-LABEL: define {{[^@]+}}@__omp_offloading_2b_10393b5_generic_l20 |
| ; CHECK-SAME: () #[[ATTR0]] { |
| ; CHECK-NEXT: entry: |
| ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @__omp_offloading_2b_10393b5_generic_l20_kernel_environment) |
| ; CHECK-NEXT: [[THREAD_ID_IN_BLOCK:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() |
| ; CHECK-NEXT: [[THREAD_IS_MAIN:%.*]] = icmp ne i32 [[THREAD_ID_IN_BLOCK]], 0 |
| ; CHECK-NEXT: br i1 [[THREAD_IS_MAIN]], label [[EXIT_THREADS:%.*]], label [[MAIN_THREAD_USER_CODE:%.*]] |
| ; CHECK: exit.threads: |
| ; CHECK-NEXT: ret void |
| ; CHECK: main.thread.user_code: |
| ; CHECK-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 |
| ; CHECK-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] |
| ; CHECK: user_code.entry: |
| ; CHECK-NEXT: call void @generic_helper() #[[ATTR7:[0-9]+]] |
| ; CHECK-NEXT: call void @__kmpc_target_deinit() |
| ; CHECK-NEXT: ret void |
| ; CHECK: worker.exit: |
| ; CHECK-NEXT: ret void |
| ; |
| ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@__omp_offloading_2b_10393b5_generic_l20 |
| ; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR0]] { |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @__omp_offloading_2b_10393b5_generic_l20_kernel_environment) |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]] |
| ; CHECK-DISABLE-SPMDIZATION: user_code.entry: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @generic_helper() #[[ATTR7:[0-9]+]] |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__kmpc_target_deinit() |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void |
| ; CHECK-DISABLE-SPMDIZATION: worker.exit: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void |
| ; |
| entry: |
| %0 = call i32 @__kmpc_target_init(ptr @__omp_offloading_2b_10393b5_generic_l20_kernel_environment) |
| %exec_user_code = icmp eq i32 %0, -1 |
| br i1 %exec_user_code, label %user_code.entry, label %worker.exit |
| |
| user_code.entry: ; preds = %entry |
| call void @generic_helper() #5 |
| call void @__kmpc_target_deinit() |
| ret void |
| |
| worker.exit: ; preds = %entry |
| ret void |
| } |
| |
| ; Function Attrs: convergent noinline nounwind |
| define internal void @spmd_helper() #1 { |
| ; CHECK-LABEL: define {{[^@]+}}@spmd_helper |
| ; CHECK-SAME: () #[[ATTR1:[0-9]+]] { |
| ; CHECK-NEXT: entry: |
| ; CHECK-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 |
| ; CHECK-NEXT: call void @leaf() #[[ATTR7]] |
| ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3:[0-9]+]] |
| ; CHECK-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__, ptr @__omp_outlined___wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) |
| ; CHECK-NEXT: ret void |
| ; |
| ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@spmd_helper |
| ; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR1:[0-9]+]] { |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [0 x ptr], align 8 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR7]] |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]]) #[[ATTR3:[0-9]+]] |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB2]], i32 [[TMP0]], i32 1, i32 -1, i32 -1, ptr @__omp_outlined__, ptr @__omp_outlined___wrapper, ptr [[CAPTURED_VARS_ADDRS]], i64 0) |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void |
| ; |
| entry: |
| %captured_vars_addrs = alloca [0 x ptr], align 8 |
| call void @leaf() #5 |
| %0 = call i32 @__kmpc_global_thread_num(ptr @2) |
| call void @__kmpc_parallel_51(ptr @2, i32 %0, i32 1, i32 -1, i32 -1, ptr @__omp_outlined__, ptr @__omp_outlined___wrapper, ptr %captured_vars_addrs, i64 0) |
| ret void |
| } |
| |
| ; Function Attrs: convergent noinline norecurse nounwind |
| define internal void @__omp_outlined__(ptr noalias %.global_tid., ptr noalias %.bound_tid.) { |
| ; CHECK-LABEL: define {{[^@]+}}@__omp_outlined__ |
| ; CHECK-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { |
| ; CHECK-NEXT: entry: |
| ; CHECK-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 |
| ; CHECK-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 |
| ; CHECK-NEXT: call void @unknown() #[[ATTR8:[0-9]+]] |
| ; CHECK-NEXT: ret void |
| ; |
| ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@__omp_outlined__ |
| ; CHECK-DISABLE-SPMDIZATION-SAME: (ptr noalias [[DOTGLOBAL_TID_:%.*]], ptr noalias [[DOTBOUND_TID_:%.*]]) { |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @unknown() #[[ATTR8:[0-9]+]] |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void |
| ; |
| entry: |
| %.global_tid..addr = alloca ptr, align 8 |
| %.bound_tid..addr = alloca ptr, align 8 |
| store ptr %.global_tid., ptr %.global_tid..addr, align 8 |
| store ptr %.bound_tid., ptr %.bound_tid..addr, align 8 |
| call void @unknown() #5 |
| ret void |
| } |
| |
| ; Function Attrs: convergent noinline norecurse nounwind |
| define internal void @__omp_outlined___wrapper(i16 zeroext %0, i32 %1) #2 { |
| ; CHECK-LABEL: define {{[^@]+}}@__omp_outlined___wrapper |
| ; CHECK-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { |
| ; CHECK-NEXT: entry: |
| ; CHECK-NEXT: [[DOTADDR:%.*]] = alloca i16, align 2 |
| ; CHECK-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 |
| ; CHECK-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 |
| ; CHECK-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 |
| ; CHECK-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) |
| ; CHECK-NEXT: call void @__omp_outlined__(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] |
| ; CHECK-NEXT: ret void |
| ; |
| ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@__omp_outlined___wrapper |
| ; CHECK-DISABLE-SPMDIZATION-SAME: (i16 zeroext [[TMP0:%.*]], i32 [[TMP1:%.*]]) #[[ATTR2:[0-9]+]] { |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTADDR:%.*]] = alloca i16, align 2 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: [[GLOBAL_ARGS:%.*]] = alloca ptr, align 8 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__kmpc_get_shared_variables(ptr [[GLOBAL_ARGS]]) |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @__omp_outlined__(ptr [[DOTADDR1]], ptr [[DOTZERO_ADDR]]) #[[ATTR3]] |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void |
| ; |
| entry: |
| %.addr = alloca i16, align 2 |
| %.addr1 = alloca i32, align 4 |
| %.zero.addr = alloca i32, align 4 |
| %global_args = alloca ptr, align 8 |
| store i16 %0, ptr %.addr, align 2 |
| store i32 %1, ptr %.addr1, align 4 |
| store i32 0, ptr %.zero.addr, align 4 |
| call void @__kmpc_get_shared_variables(ptr %global_args) |
| call void @__omp_outlined__(ptr %.addr1, ptr %.zero.addr) #3 |
| ret void |
| } |
| |
| declare void @__kmpc_get_shared_variables(ptr) |
| |
| ; Function Attrs: nounwind |
| declare i32 @__kmpc_global_thread_num(ptr) #3 |
| |
| ; Function Attrs: alwaysinline |
| declare void @__kmpc_parallel_51(ptr, i32, i32, i32, i32, ptr, ptr, ptr, i64) #4 |
| |
| ; Function Attrs: convergent noinline nounwind |
| define internal void @leaf() #1 { |
| ; CHECK-LABEL: define {{[^@]+}}@leaf |
| ; CHECK-SAME: () #[[ATTR5:[0-9]+]] { |
| ; CHECK-NEXT: entry: |
| ; CHECK-NEXT: br label [[REGION_CHECK_TID:%.*]] |
| ; CHECK: region.check.tid: |
| ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block() |
| ; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 0 |
| ; CHECK-NEXT: br i1 [[TMP1]], label [[REGION_GUARDED:%.*]], label [[REGION_BARRIER:%.*]] |
| ; CHECK: region.guarded: |
| ; CHECK-NEXT: store i32 42, ptr @G, align 4 |
| ; CHECK-NEXT: br label [[REGION_GUARDED_END:%.*]] |
| ; CHECK: region.guarded.end: |
| ; CHECK-NEXT: br label [[REGION_BARRIER]] |
| ; CHECK: region.barrier: |
| ; CHECK-NEXT: call void @__kmpc_barrier_simple_spmd(ptr @[[GLOB3]], i32 [[TMP0]]) |
| ; CHECK-NEXT: br label [[REGION_EXIT:%.*]] |
| ; CHECK: region.exit: |
| ; CHECK-NEXT: ret void |
| ; |
| ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@leaf |
| ; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR5:[0-9]+]] { |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: store i32 42, ptr @G, align 4 |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void |
| ; |
| entry: |
| store i32 42, ptr @G, align 4 |
| ret void |
| } |
| |
| ; Function Attrs: convergent noinline nounwind |
| define internal void @generic_helper() #1 { |
| ; CHECK-LABEL: define {{[^@]+}}@generic_helper |
| ; CHECK-SAME: () #[[ATTR5]] { |
| ; CHECK-NEXT: entry: |
| ; CHECK-NEXT: call void @leaf() #[[ATTR7]] |
| ; CHECK-NEXT: ret void |
| ; |
| ; CHECK-DISABLE-SPMDIZATION-LABEL: define {{[^@]+}}@generic_helper |
| ; CHECK-DISABLE-SPMDIZATION-SAME: () #[[ATTR5]] { |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: entry: |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: call void @leaf() #[[ATTR7]] |
| ; CHECK-DISABLE-SPMDIZATION-NEXT: ret void |
| ; |
| entry: |
| call void @leaf() #5 |
| ret void |
| } |
| |
| declare void @unknown() |
| |
| attributes #0 = { convergent noinline norecurse nounwind "kernel" "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| attributes #1 = { convergent noinline nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| attributes #2 = { convergent noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| attributes #3 = { nounwind } |
| attributes #4 = { alwaysinline } |
| attributes #5 = { convergent } |
| |
| !omp_offload.info = !{!0, !1} |
| !nvvm.annotations = !{!2, !3} |
| !llvm.module.flags = !{!4, !5, !6, !7, !8} |
| !llvm.ident = !{!9} |
| |
| !0 = !{i32 0, i32 43, i32 17011637, !"spmd", i32 12, i32 0} |
| !1 = !{i32 0, i32 43, i32 17011637, !"generic", i32 20, i32 1} |
| !2 = !{ptr @__omp_offloading_2b_10393b5_spmd_l12, !"kernel", i32 1} |
| !3 = !{ptr @__omp_offloading_2b_10393b5_generic_l20, !"kernel", i32 1} |
| !4 = !{i32 1, !"wchar_size", i32 4} |
| !5 = !{i32 7, !"openmp", i32 50} |
| !6 = !{i32 7, !"openmp-device", i32 50} |
| !7 = !{i32 8, !"PIC Level", i32 2} |
| !8 = !{i32 7, !"frame-pointer", i32 2} |
| !9 = !{!"clang version 14.0.0"} |
| ;. |
| ; CHECK: attributes #[[ATTR0]] = { convergent noinline norecurse nounwind "frame-pointer"="all" "kernel" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| ; CHECK: attributes #[[ATTR1]] = { noinline nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| ; CHECK: attributes #[[ATTR2]] = { noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| ; CHECK: attributes #[[ATTR3]] = { nounwind } |
| ; CHECK: attributes #[[ATTR4:[0-9]+]] = { alwaysinline } |
| ; CHECK: attributes #[[ATTR5]] = { noinline nosync nounwind memory(write) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| ; CHECK: attributes #[[ATTR6]] = { convergent nounwind } |
| ; CHECK: attributes #[[ATTR7]] = { convergent nosync nounwind memory(write) } |
| ; CHECK: attributes #[[ATTR8]] = { convergent } |
| ;. |
| ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR0]] = { convergent noinline norecurse nounwind "frame-pointer"="all" "kernel" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR1]] = { noinline nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR2]] = { noinline norecurse nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR3]] = { nounwind } |
| ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR4:[0-9]+]] = { alwaysinline } |
| ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR5]] = { noinline nosync nounwind memory(write) "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="sm_53" "target-features"="+ptx32,+sm_53" } |
| ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR6]] = { convergent nounwind } |
| ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR7]] = { convergent nosync nounwind memory(write) } |
| ; CHECK-DISABLE-SPMDIZATION: attributes #[[ATTR8]] = { convergent } |
| ;. |
| ; CHECK: [[META0:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"spmd", i32 12, i32 0} |
| ; CHECK: [[META1:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"generic", i32 20, i32 1} |
| ; CHECK: [[META2:![0-9]+]] = !{ptr @__omp_offloading_2b_10393b5_spmd_l12, !"kernel", i32 1} |
| ; CHECK: [[META3:![0-9]+]] = !{ptr @__omp_offloading_2b_10393b5_generic_l20, !"kernel", i32 1} |
| ; CHECK: [[META4:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} |
| ; CHECK: [[META5:![0-9]+]] = !{i32 7, !"openmp", i32 50} |
| ; CHECK: [[META6:![0-9]+]] = !{i32 7, !"openmp-device", i32 50} |
| ; CHECK: [[META7:![0-9]+]] = !{i32 8, !"PIC Level", i32 2} |
| ; CHECK: [[META8:![0-9]+]] = !{i32 7, !"frame-pointer", i32 2} |
| ; CHECK: [[META9:![0-9]+]] = !{!"clang version 14.0.0"} |
| ;. |
| ; CHECK-DISABLE-SPMDIZATION: [[META0:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"spmd", i32 12, i32 0} |
| ; CHECK-DISABLE-SPMDIZATION: [[META1:![0-9]+]] = !{i32 0, i32 43, i32 17011637, !"generic", i32 20, i32 1} |
| ; CHECK-DISABLE-SPMDIZATION: [[META2:![0-9]+]] = !{ptr @__omp_offloading_2b_10393b5_spmd_l12, !"kernel", i32 1} |
| ; CHECK-DISABLE-SPMDIZATION: [[META3:![0-9]+]] = !{ptr @__omp_offloading_2b_10393b5_generic_l20, !"kernel", i32 1} |
| ; CHECK-DISABLE-SPMDIZATION: [[META4:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} |
| ; CHECK-DISABLE-SPMDIZATION: [[META5:![0-9]+]] = !{i32 7, !"openmp", i32 50} |
| ; CHECK-DISABLE-SPMDIZATION: [[META6:![0-9]+]] = !{i32 7, !"openmp-device", i32 50} |
| ; CHECK-DISABLE-SPMDIZATION: [[META7:![0-9]+]] = !{i32 8, !"PIC Level", i32 2} |
| ; CHECK-DISABLE-SPMDIZATION: [[META8:![0-9]+]] = !{i32 7, !"frame-pointer", i32 2} |
| ; CHECK-DISABLE-SPMDIZATION: [[META9:![0-9]+]] = !{!"clang version 14.0.0"} |
| ;. |