mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 11:16:06 +00:00

Summary: When we were first porting to COV5, this lead to some ABI issues due to a change in how we looked up the work group size. Bitcode libraries relied on the builtins to emit code, but this was changed between versions. This prevented the bitcode libraries, like OpenMP or libc, from being used for both COV4 and COV5. The solution was to have this 'none' functionality which effectively emitted code that branched off of a global to resolve to either version. This isn't a great solution because it forced every TU to have this variable in it. The patch in https://github.com/llvm/llvm-project/pull/131033 removed support for COV4 from OpenMP, which was the only consumer of this functionality. Other users like HIP and OpenCL did not use this because they linked the ROCm Device Library directly which has its own handling (The name was borrowed from it after all). So, now that we don't need to worry about backward compatibility with COV4, we can remove this special handling. Users can still emit COV4 code, this simply removes the special handling used to make the OpenMP device runtime bitcode version agnostic.
45 lines
2.1 KiB
Plaintext
45 lines
2.1 KiB
Plaintext
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
|
|
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -fno-ident -fcuda-is-device \
|
|
// RUN: -emit-llvm -o - %s | FileCheck -check-prefix=OPTNONE %s
|
|
|
|
#define __device__ __attribute__((device))
|
|
#define __global__ __attribute__((global))
|
|
|
|
//.
|
|
// OPTNONE: @__hip_cuid_ = addrspace(1) global i8 0
|
|
// OPTNONE: @llvm.compiler.used = appending addrspace(1) global [1 x ptr] [ptr addrspacecast (ptr addrspace(1) @__hip_cuid_ to ptr)], section "llvm.metadata"
|
|
//.
|
|
__device__ void extern_func();
|
|
|
|
// OPTNONE: Function Attrs: convergent mustprogress noinline nounwind optnone
|
|
// OPTNONE-LABEL: define {{[^@]+}}@_Z4funcv
|
|
// OPTNONE-SAME: () #[[ATTR0:[0-9]+]] {
|
|
// OPTNONE-NEXT: entry:
|
|
// OPTNONE-NEXT: call void @_Z11extern_funcv() #[[ATTR3:[0-9]+]]
|
|
// OPTNONE-NEXT: ret void
|
|
//
|
|
__device__ void func() {
|
|
extern_func();
|
|
}
|
|
|
|
// OPTNONE: Function Attrs: convergent mustprogress noinline norecurse nounwind optnone
|
|
// OPTNONE-LABEL: define {{[^@]+}}@_Z6kernelv
|
|
// OPTNONE-SAME: () #[[ATTR2:[0-9]+]] {
|
|
// OPTNONE-NEXT: entry:
|
|
// OPTNONE-NEXT: call void @_Z11extern_funcv() #[[ATTR3]]
|
|
// OPTNONE-NEXT: ret void
|
|
//
|
|
__global__ void kernel() {
|
|
extern_func();
|
|
}
|
|
//.
|
|
// OPTNONE: attributes #[[ATTR0]] = { convergent mustprogress noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
|
|
// OPTNONE: attributes #[[ATTR1:[0-9]+]] = { convergent nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
|
|
// OPTNONE: attributes #[[ATTR2]] = { convergent mustprogress noinline norecurse nounwind optnone "amdgpu-flat-work-group-size"="1,1024" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" }
|
|
// OPTNONE: attributes #[[ATTR3]] = { convergent nounwind }
|
|
//.
|
|
// OPTNONE: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
|
|
// OPTNONE: [[META1:![0-9]+]] = !{i32 1, !"amdgpu_printf_kind", !"hostcall"}
|
|
// OPTNONE: [[META2:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
|
|
//.
|