Skip to content

Commit 68bcba6

Browse files
committed
Revert "[AMDGPU] Use COV6 by default (#118515)"
This reverts commit 410cbe3 because some buildbots are not ready yet.
1 parent 14a259f commit 68bcba6

File tree

18 files changed

+20
-32
lines changed

18 files changed

+20
-32
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,6 @@ Target Specific Changes
818818
AMDGPU Support
819819
^^^^^^^^^^^^^^
820820

821-
- Bump the default code object version to 6.
822-
823821
- Initial support for gfx950
824822

825823
- Added headers ``gpuintrin.h`` and ``amdgpuintrin.h`` that contains common

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5140,12 +5140,12 @@ defm amdgpu_ieee : BoolMOption<"amdgpu-ieee",
51405140
NegFlag<SetFalse, [], [ClangOption, CC1Option]>>;
51415141

51425142
def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Group>,
5143-
HelpText<"Specify code object ABI version. Defaults to 6. (AMDGPU only)">,
5143+
HelpText<"Specify code object ABI version. Defaults to 5. (AMDGPU only)">,
51445144
Visibility<[ClangOption, FlangOption, CC1Option, FC1Option]>,
51455145
Values<"none,4,5,6">,
51465146
NormalizedValuesScope<"llvm::CodeObjectVersionKind">,
51475147
NormalizedValues<["COV_None", "COV_4", "COV_5", "COV_6"]>,
5148-
MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_6">;
5148+
MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_5">;
51495149

51505150
defm cumode : SimpleMFlag<"cumode",
51515151
"Specify CU wavefront", "Specify WGP wavefront",

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2705,7 +2705,7 @@ void tools::checkAMDGPUCodeObjectVersion(const Driver &D,
27052705

27062706
unsigned tools::getAMDGPUCodeObjectVersion(const Driver &D,
27072707
const llvm::opt::ArgList &Args) {
2708-
unsigned CodeObjVer = 6; // default
2708+
unsigned CodeObjVer = 5; // default
27092709
if (auto *CodeObjArg = getAMDGPUCodeObjectArgument(D, Args))
27102710
StringRef(CodeObjArg->getValue()).getAsInteger(0, CodeObjVer);
27112711
return CodeObjVer;

clang/test/CodeGen/amdgpu-address-spaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int [[clang::address_space(999)]] bbb = 1234;
2929
// CHECK: @u = addrspace(5) global i32 undef, align 4
3030
// CHECK: @aaa = addrspace(6) global i32 1000, align 4
3131
// CHECK: @bbb = addrspace(999) global i32 1234, align 4
32-
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
32+
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
3333
//.
3434
// CHECK-LABEL: define dso_local amdgpu_kernel void @foo(
3535
// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {

clang/test/CodeGenCUDA/amdgpu-code-object-version.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Create module flag for code object version.
22

33
// RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -emit-llvm \
4-
// RUN: -o - %s | FileCheck %s -check-prefix=V6
4+
// RUN: -o - %s | FileCheck %s -check-prefix=V5
55

66
// RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -emit-llvm \
77
// RUN: -mcode-object-version=4 -o - %s | FileCheck -check-prefix=V4 %s

clang/test/CodeGenCXX/dynamic-cast-address-space.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ B fail;
1313
// CHECK: @_ZTI1B = linkonce_odr addrspace(1) constant { ptr addrspace(1), ptr addrspace(1), ptr addrspace(1) } { ptr addrspace(1) getelementptr inbounds (ptr addrspace(1), ptr addrspace(1) @_ZTVN10__cxxabiv120__si_class_type_infoE, i64 2), ptr addrspace(1) @_ZTS1B, ptr addrspace(1) @_ZTI1A }, comdat, align 8
1414
// CHECK: @_ZTVN10__cxxabiv120__si_class_type_infoE = external addrspace(1) global [0 x ptr addrspace(1)]
1515
// CHECK: @_ZTS1B = linkonce_odr addrspace(1) constant [3 x i8] c"1B\00", comdat, align 1
16-
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
16+
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
1717
//.
1818
// WITH-NONZERO-DEFAULT-AS: @_ZTV1B = linkonce_odr unnamed_addr addrspace(1) constant { [3 x ptr addrspace(1)] } { [3 x ptr addrspace(1)] [ptr addrspace(1) null, ptr addrspace(1) @_ZTI1B, ptr addrspace(1) addrspacecast (ptr addrspace(4) @_ZN1A1fEv to ptr addrspace(1))] }, comdat, align 8
1919
// WITH-NONZERO-DEFAULT-AS: @fail = addrspace(1) global { ptr addrspace(1) } { ptr addrspace(1) getelementptr inbounds inrange(-16, 8) ({ [3 x ptr addrspace(1)] }, ptr addrspace(1) @_ZTV1B, i32 0, i32 0, i32 2) }, align 8
@@ -118,11 +118,11 @@ const B& f(A *a) {
118118
// WITH-NONZERO-DEFAULT-AS: attributes #[[ATTR3]] = { nounwind }
119119
// WITH-NONZERO-DEFAULT-AS: attributes #[[ATTR4]] = { noreturn }
120120
//.
121-
// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
121+
// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
122122
// CHECK: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
123123
// CHECK: [[META2:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
124124
//.
125-
// WITH-NONZERO-DEFAULT-AS: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
125+
// WITH-NONZERO-DEFAULT-AS: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
126126
// WITH-NONZERO-DEFAULT-AS: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
127127
// WITH-NONZERO-DEFAULT-AS: [[META2:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
128128
//.

clang/test/CodeGenHIP/default-attributes.hip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//.
99
// OPTNONE: @__hip_cuid_ = addrspace(1) global i8 0
1010
// OPTNONE: @llvm.compiler.used = appending addrspace(1) global [1 x ptr] [ptr addrspacecast (ptr addrspace(1) @__hip_cuid_ to ptr)], section "llvm.metadata"
11-
// OPTNONE: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
11+
// OPTNONE: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
1212
//.
1313
__device__ void extern_func();
1414

@@ -39,7 +39,7 @@ __global__ void kernel() {
3939
// 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" }
4040
// OPTNONE: attributes #[[ATTR3]] = { convergent nounwind }
4141
//.
42-
// OPTNONE: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
42+
// OPTNONE: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
4343
// OPTNONE: [[META1:![0-9]+]] = !{i32 1, !"amdgpu_printf_kind", !"hostcall"}
4444
// OPTNONE: [[META2:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
4545
//.

clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ kernel void test_target_features_kernel(global int *i) {
6262

6363
//.
6464
// CHECK: @__block_literal_global = internal addrspace(1) constant { i32, i32, ptr } { i32 16, i32 8, ptr @__test_target_features_kernel_block_invoke }, align 8 #0
65-
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
65+
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
6666
//.
6767
// NOCPU: Function Attrs: convergent noinline norecurse nounwind optnone
6868
// NOCPU-LABEL: define {{[^@]+}}@callee
@@ -759,7 +759,7 @@ kernel void test_target_features_kernel(global int *i) {
759759
// GFX900: attributes #[[ATTR8]] = { nounwind }
760760
// GFX900: attributes #[[ATTR9]] = { convergent nounwind }
761761
//.
762-
// NOCPU: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
762+
// NOCPU: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
763763
// NOCPU: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
764764
// NOCPU: [[META2:![0-9]+]] = !{i32 2, i32 0}
765765
// NOCPU: [[META3]] = !{i32 1, i32 0, i32 1, i32 0}
@@ -777,7 +777,7 @@ kernel void test_target_features_kernel(global int *i) {
777777
// NOCPU: [[META15]] = !{i32 1}
778778
// NOCPU: [[META16]] = !{!"int*"}
779779
//.
780-
// GFX900: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
780+
// GFX900: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
781781
// GFX900: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
782782
// GFX900: [[META2:![0-9]+]] = !{i32 2, i32 0}
783783
// GFX900: [[TBAA3]] = !{[[META4:![0-9]+]], [[META4]], i64 0}

clang/test/Driver/Inputs/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z/amdgcn/bitcode/oclc_abi_version_600.bc

Whitespace-only changes.

clang/test/Driver/Inputs/rocm_resource_dir/lib/amdgcn/bitcode/oclc_abi_version_600.bc

Whitespace-only changes.

clang/test/Driver/Inputs/rocm_resource_dir/lib64/amdgcn/bitcode/oclc_abi_version_600.bc

Whitespace-only changes.

clang/test/Driver/hip-device-libs.hip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
// Test default code object version.
158158
// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \
159159
// RUN: --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \
160-
// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI6
160+
// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI5
161161

162162
// Test default code object version with old device library without abi_version_400.bc
163163
// RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \

clang/test/OpenMP/amdgcn_target_global_constructor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ S A;
2929
// CHECK: @A = addrspace(1) global %struct.S zeroinitializer, align 4
3030
// CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_amdgcn_target_global_constructor.cpp, ptr null }]
3131
// CHECK: @llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @__dtor_A, ptr null }]
32-
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
32+
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
3333
//.
3434
// CHECK-LABEL: define {{[^@]+}}@__cxx_global_var_init
3535
// CHECK-SAME: () #[[ATTR0:[0-9]+]] {
@@ -104,7 +104,7 @@ S A;
104104
// CHECK: attributes #[[ATTR4]] = { convergent nounwind }
105105
//.
106106
// CHECK: [[META0:![0-9]+]] = !{i32 1, !"A", i32 0, i32 0}
107-
// CHECK: [[META1:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
107+
// CHECK: [[META1:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
108108
// CHECK: [[META2:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
109109
// CHECK: [[META3:![0-9]+]] = !{i32 7, !"openmp", i32 51}
110110
// CHECK: [[META4:![0-9]+]] = !{i32 7, !"openmp-device", i32 51}

libc/cmake/modules/prepare_libc_gpu_build.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
104104
# The AMDGPU environment uses different code objects to encode the ABI for
105105
# kernel calls and intrinsic functions. We want to specify this manually to
106106
# conform to whatever the test suite was built to handle.
107-
set(LIBC_GPU_CODE_OBJECT_VERSION 6)
107+
set(LIBC_GPU_CODE_OBJECT_VERSION 5)
108108
endif()
109109

110110
if(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)

llvm/docs/ReleaseNotes.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ Changes to the AArch64 Backend
130130
Changes to the AMDGPU Backend
131131
-----------------------------
132132

133-
* Bump the default `.amdhsa_code_object_version` to 6.
134-
135133
* Removed `llvm.amdgcn.flat.atomic.fadd` and
136134
`llvm.amdgcn.global.atomic.fadd` intrinsics. Users should use the
137135
{ref}`atomicrmw <i_atomicrmw>` instruction with `fadd` and

llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
static llvm::cl::opt<unsigned> DefaultAMDHSACodeObjectVersion(
3636
"amdhsa-code-object-version", llvm::cl::Hidden,
37-
llvm::cl::init(llvm::AMDGPU::AMDHSA_COV6),
37+
llvm::cl::init(llvm::AMDGPU::AMDHSA_COV5),
3838
llvm::cl::desc("Set default AMDHSA Code Object Version (module flag "
3939
"or asm directive still take priority if present)"));
4040

llvm/test/CodeGen/AMDGPU/default_amdhsa_code_object_version.ll

Lines changed: 0 additions & 7 deletions
This file was deleted.

offload/plugins-nextgen/common/src/Utils/ELF.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ checkMachineImpl(const object::ELFObjectFile<ELFT> &ELFObj, uint16_t EMachine) {
6464
if (Header.e_ident[EI_OSABI] != ELFOSABI_AMDGPU_HSA)
6565
return createError("Invalid AMD OS/ABI, must be AMDGPU_HSA");
6666
if (Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V4 &&
67-
Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V5 &&
68-
Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V6)
69-
return createError("Invalid AMD ABI version, must be version above 4");
67+
Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V5)
68+
return createError("Invalid AMD ABI version, must be version 4 or 5");
7069
if ((Header.e_flags & EF_AMDGPU_MACH) < EF_AMDGPU_MACH_AMDGCN_GFX700 ||
7170
(Header.e_flags & EF_AMDGPU_MACH) > EF_AMDGPU_MACH_AMDGCN_GFX1201)
7271
return createError("Unsupported AMDGPU architecture");

0 commit comments

Comments
 (0)