Skip to content

Commit 7355d37

Browse files
committed
[AMDGPU] Use COV6 by default
(cherry picked from commit d3eebcd)
1 parent 6b399cb commit 7355d37

File tree

19 files changed

+33
-35
lines changed

19 files changed

+33
-35
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ sections with improvements to Clang's support for those languages.
193193

194194
C++ Language Changes
195195
--------------------
196-
- Allow single element access of GCC vector/ext_vector_type object to be
197-
constant expression. Supports the `V.xyzw` syntax and other tidbits
196+
- Allow single element access of GCC vector/ext_vector_type object to be
197+
constant expression. Supports the `V.xyzw` syntax and other tidbits
198198
as seen in OpenCL. Selecting multiple elements is left as a future work.
199199
While the implementation already existed since Clang 4, it was turned off by
200200
default, and was controlled with the `-frelaxed-template-template-args` flag.
@@ -766,7 +766,7 @@ Improvements to Clang's diagnostics
766766

767767
- Clang now diagnoses dangling assignments for pointer-like objects (annotated with `[[gsl::Pointer]]`) under `-Wdangling-assignment-gsl` (off by default)
768768
Fixes #GH63310.
769-
769+
770770
- Clang now diagnoses uses of alias templates with a deprecated attribute. (Fixes #GH18236).
771771

772772
.. code-block:: c++
@@ -1160,6 +1160,8 @@ AMDGPU Support
11601160
definitions for GPU builtin functions. This header can be included for OpenMP,
11611161
CUDA, HIP, OpenCL, and C/C++.
11621162

1163+
- Bump the default code object version to 6.
1164+
11631165
NVPTX Support
11641166
^^^^^^^^^^^^^^
11651167

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ def err_drv_hipspv_no_hip_path : Error<
9696
"'--hip-path' must be specified when offloading to SPIR-V unless '-nogpuinc' "
9797
"is given">;
9898

99-
// TODO: Remove when COV6 is fully supported by ROCm.
100-
def warn_drv_amdgpu_cov6: Warning<
101-
"code object v6 is still in development and not ready for production use yet;"
102-
" use at your own risk">;
10399
def err_drv_undetermined_gpu_arch : Error<
104100
"cannot determine %0 architecture: %1; consider passing it via "
105101
"'%2'">;

clang/include/clang/Driver/Options.td

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

51355135
def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Group>,
5136-
HelpText<"Specify code object ABI version. Defaults to 5. (AMDGPU only)">,
5136+
HelpText<"Specify code object ABI version. Defaults to 6. (AMDGPU only)">,
51375137
Visibility<[ClangOption, FlangOption, CC1Option, FC1Option]>,
51385138
Values<"none,4,5,6">,
51395139
NormalizedValuesScope<"llvm::CodeObjectVersionKind">,
51405140
NormalizedValues<["COV_None", "COV_4", "COV_5", "COV_6"]>,
5141-
MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_5">;
5141+
MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_6">;
51425142

51435143
defm cumode : SimpleMFlag<"cumode",
51445144
"Specify CU wavefront", "Specify WGP wavefront",

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,19 +2851,13 @@ void tools::checkAMDGPUCodeObjectVersion(const Driver &D,
28512851
if (Remnant || CodeObjVer < MinCodeObjVer || CodeObjVer > MaxCodeObjVer)
28522852
D.Diag(diag::err_drv_invalid_int_value)
28532853
<< CodeObjArg->getAsString(Args) << CodeObjArg->getValue();
2854-
2855-
// COV6 is only supported by LLVM at the time of writing this, and it's
2856-
// expected to take some time before all ROCm components fully
2857-
// support it. In the meantime, make sure users are aware of this.
2858-
if (CodeObjVer == 6)
2859-
D.Diag(diag::warn_drv_amdgpu_cov6);
28602854
}
28612855
}
28622856
}
28632857

28642858
unsigned tools::getAMDGPUCodeObjectVersion(const Driver &D,
28652859
const llvm::opt::ArgList &Args) {
2866-
unsigned CodeObjVer = 5; // default
2860+
unsigned CodeObjVer = 6; // default
28672861
if (auto *CodeObjArg = getAMDGPUCodeObjectArgument(D, Args))
28682862
StringRef(CodeObjArg->getValue()).getAsInteger(0, CodeObjVer);
28692863
return CodeObjVer;

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

Lines changed: 2 additions & 2 deletions
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 500
32+
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
3333
//.
3434
// CHECK-LABEL: define dso_local amdgpu_kernel void @foo(
3535
// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
@@ -63,7 +63,7 @@ extern "C" [[clang::amdgpu_kernel]] void foo() {
6363
//.
6464
// CHECK: attributes #[[ATTR0]] = { mustprogress noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
6565
//.
66-
// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
66+
// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
6767
// CHECK: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
6868
// CHECK: [[META2:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
6969
//.

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=V5
4+
// RUN: -o - %s | FileCheck %s -check-prefix=V6
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: @_ZTVN10__cxxabiv120__si_class_type_infoE = external addrspace(1) global [0 x ptr addrspace(1)]
1414
// CHECK: @_ZTS1B = linkonce_odr addrspace(1) constant [3 x i8] c"1B\00", comdat, align 1
1515
// 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
16-
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
16+
// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
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 500}
121+
// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
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 500}
125+
// WITH-NONZERO-DEFAULT-AS: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
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
@@ -46,11 +46,11 @@ __global__ void kernel() {
4646
// OPT: attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
4747
// OPT: attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) "amdgpu-flat-work-group-size"="1,1024" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" }
4848
//.
49-
// OPTNONE: !0 = !{i32 1, !"amdhsa_code_object_version", i32 500}
49+
// OPTNONE: !0 = !{i32 1, !"amdhsa_code_object_version", i32 600}
5050
// OPTNONE: !1 = !{i32 1, !"amdgpu_printf_kind", !"hostcall"}
5151
// OPTNONE: !2 = !{i32 1, !"wchar_size", i32 4}
5252
//.
53-
// OPT: !0 = !{i32 1, !"amdhsa_code_object_version", i32 500}
53+
// OPT: !0 = !{i32 1, !"amdhsa_code_object_version", i32 600}
5454
// OPT: !1 = !{i32 1, !"amdgpu_printf_kind", !"hostcall"}
5555
// OPT: !2 = !{i32 1, !"wchar_size", i32 4}
5656
//.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ kernel void test_target_features_kernel(global int *i) {
703703
// GFX900: attributes #8 = { nounwind }
704704
// GFX900: attributes #9 = { convergent nounwind }
705705
//.
706-
// NOCPU: !0 = !{i32 1, !"amdhsa_code_object_version", i32 500}
706+
// NOCPU: !0 = !{i32 1, !"amdhsa_code_object_version", i32 600}
707707
// NOCPU: !1 = !{i32 1, !"wchar_size", i32 4}
708708
// NOCPU: !2 = !{i32 2, i32 0}
709709
// NOCPU: !3 = !{i32 1, i32 0, i32 1, i32 0}
@@ -721,7 +721,7 @@ kernel void test_target_features_kernel(global int *i) {
721721
// NOCPU: !15 = !{i32 1}
722722
// NOCPU: !16 = !{!"int*"}
723723
//.
724-
// GFX900: !0 = !{i32 1, !"amdhsa_code_object_version", i32 500}
724+
// GFX900: !0 = !{i32 1, !"amdhsa_code_object_version", i32 600}
725725
// GFX900: !1 = !{i32 1, !"wchar_size", i32 4}
726726
// GFX900: !2 = !{i32 2, i32 0}
727727
// GFX900: !3 = !{!4, !4, i64 0}

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

Whitespace-only changes.

0 commit comments

Comments
 (0)