Skip to content

Conversation

@shiltian
Copy link
Contributor

@shiltian shiltian commented Dec 3, 2024

No description provided.

@llvmbot llvmbot added clang Clang issues not falling into any other category backend:AMDGPU clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:openmp OpenMP related changes to Clang offload labels Dec 3, 2024
Copy link
Contributor Author

shiltian commented Dec 3, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@shiltian shiltian requested a review from yxsamliu December 3, 2024 17:10
@llvmbot
Copy link
Member

llvmbot commented Dec 3, 2024

@llvm/pr-subscribers-libc
@llvm/pr-subscribers-backend-amdgpu
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-driver

Author: Shilei Tian (shiltian)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/118515.diff

13 Files Affected:

  • (modified) clang/include/clang/Driver/Options.td (+5-5)
  • (modified) clang/lib/Driver/ToolChains/CommonArgs.cpp (+1-1)
  • (modified) clang/test/CodeGen/amdgpu-address-spaces.cpp (+1-1)
  • (modified) clang/test/CodeGenCUDA/amdgpu-code-object-version.cu (+1-1)
  • (modified) clang/test/CodeGenCXX/dynamic-cast-address-space.cpp (+3-3)
  • (modified) clang/test/CodeGenHIP/default-attributes.hip (+2-2)
  • (modified) clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl (+3-3)
  • (added) clang/test/Driver/Inputs/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z/amdgcn/bitcode/oclc_abi_version_600.bc ()
  • (added) clang/test/Driver/Inputs/rocm_resource_dir/lib/amdgcn/bitcode/oclc_abi_version_600.bc ()
  • (added) clang/test/Driver/Inputs/rocm_resource_dir/lib64/amdgcn/bitcode/oclc_abi_version_600.bc ()
  • (modified) clang/test/Driver/hip-device-libs.hip (+1-1)
  • (modified) clang/test/OpenMP/amdgcn_target_global_constructor.cpp (+2-2)
  • (modified) offload/plugins-nextgen/common/src/Utils/ELF.cpp (+3-2)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index cb96b5daed9d3a..29db1aa21ed298 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1786,12 +1786,12 @@ defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling",
   PosFlag<SetTrue, [], [ClangOption, CC1Option],
           "Emit extra debug info to make sample profile more accurate">,
   NegFlag<SetFalse>>;
-def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">, 
+def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">,
     Group<f_Group>, Visibility<[ClangOption, CLOption]>,
     HelpText<"Generate instrumented code to collect coverage info for cold functions into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
-def fprofile_generate_cold_function_coverage_EQ : Joined<["-"], "fprofile-generate-cold-function-coverage=">, 
+def fprofile_generate_cold_function_coverage_EQ : Joined<["-"], "fprofile-generate-cold-function-coverage=">,
     Group<f_Group>, Visibility<[ClangOption, CLOption]>, MetaVarName<"<directory>">,
-    HelpText<"Generate instrumented code to collect coverage info for cold functions into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">; 
+    HelpText<"Generate instrumented code to collect coverage info for cold functions into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
 def fprofile_instr_generate : Flag<["-"], "fprofile-instr-generate">,
     Group<f_Group>, Visibility<[ClangOption, CLOption]>,
     HelpText<"Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
@@ -5140,12 +5140,12 @@ defm amdgpu_ieee : BoolMOption<"amdgpu-ieee",
   NegFlag<SetFalse, [], [ClangOption, CC1Option]>>;
 
 def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Group>,
-  HelpText<"Specify code object ABI version. Defaults to 5. (AMDGPU only)">,
+  HelpText<"Specify code object ABI version. Defaults to 6. (AMDGPU only)">,
   Visibility<[ClangOption, FlangOption, CC1Option, FC1Option]>,
   Values<"none,4,5,6">,
   NormalizedValuesScope<"llvm::CodeObjectVersionKind">,
   NormalizedValues<["COV_None", "COV_4", "COV_5", "COV_6"]>,
-  MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_5">;
+  MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_6">;
 
 defm cumode : SimpleMFlag<"cumode",
   "Specify CU wavefront", "Specify WGP wavefront",
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 8d977149e62485..4e6ace48c3ffb5 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2705,7 +2705,7 @@ void tools::checkAMDGPUCodeObjectVersion(const Driver &D,
 
 unsigned tools::getAMDGPUCodeObjectVersion(const Driver &D,
                                            const llvm::opt::ArgList &Args) {
-  unsigned CodeObjVer = 5; // default
+  unsigned CodeObjVer = 6; // default
   if (auto *CodeObjArg = getAMDGPUCodeObjectArgument(D, Args))
     StringRef(CodeObjArg->getValue()).getAsInteger(0, CodeObjVer);
   return CodeObjVer;
diff --git a/clang/test/CodeGen/amdgpu-address-spaces.cpp b/clang/test/CodeGen/amdgpu-address-spaces.cpp
index ae2c61439f4ca5..b121b559f58dc3 100644
--- a/clang/test/CodeGen/amdgpu-address-spaces.cpp
+++ b/clang/test/CodeGen/amdgpu-address-spaces.cpp
@@ -29,7 +29,7 @@ int [[clang::address_space(999)]] bbb = 1234;
 // CHECK: @u = addrspace(5) global i32 undef, align 4
 // CHECK: @aaa = addrspace(6) global i32 1000, align 4
 // CHECK: @bbb = addrspace(999) global i32 1234, align 4
-// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 // CHECK-LABEL: define dso_local amdgpu_kernel void @foo(
 // CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
diff --git a/clang/test/CodeGenCUDA/amdgpu-code-object-version.cu b/clang/test/CodeGenCUDA/amdgpu-code-object-version.cu
index ffe12544917f7f..aa0e3edec3f6a3 100644
--- a/clang/test/CodeGenCUDA/amdgpu-code-object-version.cu
+++ b/clang/test/CodeGenCUDA/amdgpu-code-object-version.cu
@@ -1,7 +1,7 @@
 // Create module flag for code object version.
 
 // RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -emit-llvm \
-// RUN:   -o - %s | FileCheck %s -check-prefix=V5
+// RUN:   -o - %s | FileCheck %s -check-prefix=V6
 
 // RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -emit-llvm \
 // RUN:   -mcode-object-version=4 -o - %s | FileCheck -check-prefix=V4 %s
diff --git a/clang/test/CodeGenCXX/dynamic-cast-address-space.cpp b/clang/test/CodeGenCXX/dynamic-cast-address-space.cpp
index 271d9ede79d0c4..7eebdf68115a98 100644
--- a/clang/test/CodeGenCXX/dynamic-cast-address-space.cpp
+++ b/clang/test/CodeGenCXX/dynamic-cast-address-space.cpp
@@ -13,7 +13,7 @@ B fail;
 // 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
 // CHECK: @_ZTVN10__cxxabiv120__si_class_type_infoE = external addrspace(1) global [0 x ptr addrspace(1)]
 // CHECK: @_ZTS1B = linkonce_odr addrspace(1) constant [3 x i8] c"1B\00", comdat, align 1
-// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 // 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
 // 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) {
 // WITH-NONZERO-DEFAULT-AS: attributes #[[ATTR3]] = { nounwind }
 // WITH-NONZERO-DEFAULT-AS: attributes #[[ATTR4]] = { noreturn }
 //.
-// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // CHECK: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // CHECK: [[META2:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
 //.
-// WITH-NONZERO-DEFAULT-AS: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// WITH-NONZERO-DEFAULT-AS: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // WITH-NONZERO-DEFAULT-AS: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // WITH-NONZERO-DEFAULT-AS: [[META2:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
 //.
diff --git a/clang/test/CodeGenHIP/default-attributes.hip b/clang/test/CodeGenHIP/default-attributes.hip
index 1b53ebec9b5821..f4dbad021987f1 100644
--- a/clang/test/CodeGenHIP/default-attributes.hip
+++ b/clang/test/CodeGenHIP/default-attributes.hip
@@ -8,7 +8,7 @@
 //.
 // 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"
-// OPTNONE: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// OPTNONE: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 __device__ void extern_func();
 
@@ -39,7 +39,7 @@ __global__ void kernel() {
 // 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 500}
+// 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}
 //.
diff --git a/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl b/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
index 62b5661da9dbd8..7f2a17b6ef8c55 100644
--- a/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
+++ b/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
@@ -62,7 +62,7 @@ kernel void test_target_features_kernel(global int *i) {
 
 //.
 // 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
-// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 // NOCPU: Function Attrs: convergent noinline norecurse nounwind optnone
 // NOCPU-LABEL: define {{[^@]+}}@callee
@@ -759,7 +759,7 @@ kernel void test_target_features_kernel(global int *i) {
 // GFX900: attributes #[[ATTR8]] = { nounwind }
 // GFX900: attributes #[[ATTR9]] = { convergent nounwind }
 //.
-// NOCPU: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// NOCPU: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // NOCPU: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // NOCPU: [[META2:![0-9]+]] = !{i32 2, i32 0}
 // NOCPU: [[META3]] = !{i32 1, i32 0, i32 1, i32 0}
@@ -777,7 +777,7 @@ kernel void test_target_features_kernel(global int *i) {
 // NOCPU: [[META15]] = !{i32 1}
 // NOCPU: [[META16]] = !{!"int*"}
 //.
-// GFX900: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// GFX900: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // GFX900: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // GFX900: [[META2:![0-9]+]] = !{i32 2, i32 0}
 // GFX900: [[TBAA3]] = !{[[META4:![0-9]+]], [[META4]], i64 0}
diff --git a/clang/test/Driver/Inputs/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z/amdgcn/bitcode/oclc_abi_version_600.bc b/clang/test/Driver/Inputs/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z/amdgcn/bitcode/oclc_abi_version_600.bc
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/clang/test/Driver/Inputs/rocm_resource_dir/lib/amdgcn/bitcode/oclc_abi_version_600.bc b/clang/test/Driver/Inputs/rocm_resource_dir/lib/amdgcn/bitcode/oclc_abi_version_600.bc
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/clang/test/Driver/Inputs/rocm_resource_dir/lib64/amdgcn/bitcode/oclc_abi_version_600.bc b/clang/test/Driver/Inputs/rocm_resource_dir/lib64/amdgcn/bitcode/oclc_abi_version_600.bc
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/clang/test/Driver/hip-device-libs.hip b/clang/test/Driver/hip-device-libs.hip
index 6f1d31508e3302..3ae384cf05d972 100644
--- a/clang/test/Driver/hip-device-libs.hip
+++ b/clang/test/Driver/hip-device-libs.hip
@@ -157,7 +157,7 @@
 // Test default code object version.
 // RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \
 // RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI5
+// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI6
 
 // Test default code object version with old device library without abi_version_400.bc
 // RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \
diff --git a/clang/test/OpenMP/amdgcn_target_global_constructor.cpp b/clang/test/OpenMP/amdgcn_target_global_constructor.cpp
index 9f1e68d4ea0fec..d728dc1233e2c7 100644
--- a/clang/test/OpenMP/amdgcn_target_global_constructor.cpp
+++ b/clang/test/OpenMP/amdgcn_target_global_constructor.cpp
@@ -29,7 +29,7 @@ S A;
 // CHECK: @A = addrspace(1) global %struct.S zeroinitializer, align 4
 // 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 }]
 // CHECK: @llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @__dtor_A, ptr null }]
-// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 // CHECK-LABEL: define {{[^@]+}}@__cxx_global_var_init
 // CHECK-SAME: () #[[ATTR0:[0-9]+]] {
@@ -104,7 +104,7 @@ S A;
 // CHECK: attributes #[[ATTR4]] = { convergent nounwind }
 //.
 // CHECK: [[META0:![0-9]+]] = !{i32 1, !"A", i32 0, i32 0}
-// CHECK: [[META1:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// CHECK: [[META1:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // CHECK: [[META2:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // CHECK: [[META3:![0-9]+]] = !{i32 7, !"openmp", i32 51}
 // CHECK: [[META4:![0-9]+]] = !{i32 7, !"openmp-device", i32 51}
diff --git a/offload/plugins-nextgen/common/src/Utils/ELF.cpp b/offload/plugins-nextgen/common/src/Utils/ELF.cpp
index 88642fd5b56400..18b5ad3351b12d 100644
--- a/offload/plugins-nextgen/common/src/Utils/ELF.cpp
+++ b/offload/plugins-nextgen/common/src/Utils/ELF.cpp
@@ -64,8 +64,9 @@ checkMachineImpl(const object::ELFObjectFile<ELFT> &ELFObj, uint16_t EMachine) {
     if (Header.e_ident[EI_OSABI] != ELFOSABI_AMDGPU_HSA)
       return createError("Invalid AMD OS/ABI, must be AMDGPU_HSA");
     if (Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V4 &&
-        Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V5)
-      return createError("Invalid AMD ABI version, must be version 4 or 5");
+        Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V5 &&
+        Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V6)
+      return createError("Invalid AMD ABI version, must be version above 4");
     if ((Header.e_flags & EF_AMDGPU_MACH) < EF_AMDGPU_MACH_AMDGCN_GFX700 ||
         (Header.e_flags & EF_AMDGPU_MACH) > EF_AMDGPU_MACH_AMDGCN_GFX1201)
       return createError("Unsupported AMDGPU architecture");

@llvmbot
Copy link
Member

llvmbot commented Dec 3, 2024

@llvm/pr-subscribers-offload

Author: Shilei Tian (shiltian)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/118515.diff

13 Files Affected:

  • (modified) clang/include/clang/Driver/Options.td (+5-5)
  • (modified) clang/lib/Driver/ToolChains/CommonArgs.cpp (+1-1)
  • (modified) clang/test/CodeGen/amdgpu-address-spaces.cpp (+1-1)
  • (modified) clang/test/CodeGenCUDA/amdgpu-code-object-version.cu (+1-1)
  • (modified) clang/test/CodeGenCXX/dynamic-cast-address-space.cpp (+3-3)
  • (modified) clang/test/CodeGenHIP/default-attributes.hip (+2-2)
  • (modified) clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl (+3-3)
  • (added) clang/test/Driver/Inputs/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z/amdgcn/bitcode/oclc_abi_version_600.bc ()
  • (added) clang/test/Driver/Inputs/rocm_resource_dir/lib/amdgcn/bitcode/oclc_abi_version_600.bc ()
  • (added) clang/test/Driver/Inputs/rocm_resource_dir/lib64/amdgcn/bitcode/oclc_abi_version_600.bc ()
  • (modified) clang/test/Driver/hip-device-libs.hip (+1-1)
  • (modified) clang/test/OpenMP/amdgcn_target_global_constructor.cpp (+2-2)
  • (modified) offload/plugins-nextgen/common/src/Utils/ELF.cpp (+3-2)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index cb96b5daed9d3a..29db1aa21ed298 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1786,12 +1786,12 @@ defm debug_info_for_profiling : BoolFOption<"debug-info-for-profiling",
   PosFlag<SetTrue, [], [ClangOption, CC1Option],
           "Emit extra debug info to make sample profile more accurate">,
   NegFlag<SetFalse>>;
-def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">, 
+def fprofile_generate_cold_function_coverage : Flag<["-"], "fprofile-generate-cold-function-coverage">,
     Group<f_Group>, Visibility<[ClangOption, CLOption]>,
     HelpText<"Generate instrumented code to collect coverage info for cold functions into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
-def fprofile_generate_cold_function_coverage_EQ : Joined<["-"], "fprofile-generate-cold-function-coverage=">, 
+def fprofile_generate_cold_function_coverage_EQ : Joined<["-"], "fprofile-generate-cold-function-coverage=">,
     Group<f_Group>, Visibility<[ClangOption, CLOption]>, MetaVarName<"<directory>">,
-    HelpText<"Generate instrumented code to collect coverage info for cold functions into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">; 
+    HelpText<"Generate instrumented code to collect coverage info for cold functions into <directory>/default.profraw (overridden by LLVM_PROFILE_FILE env var)">;
 def fprofile_instr_generate : Flag<["-"], "fprofile-instr-generate">,
     Group<f_Group>, Visibility<[ClangOption, CLOption]>,
     HelpText<"Generate instrumented code to collect execution counts into default.profraw file (overridden by '=' form of option or LLVM_PROFILE_FILE env var)">;
@@ -5140,12 +5140,12 @@ defm amdgpu_ieee : BoolMOption<"amdgpu-ieee",
   NegFlag<SetFalse, [], [ClangOption, CC1Option]>>;
 
 def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group<m_Group>,
-  HelpText<"Specify code object ABI version. Defaults to 5. (AMDGPU only)">,
+  HelpText<"Specify code object ABI version. Defaults to 6. (AMDGPU only)">,
   Visibility<[ClangOption, FlangOption, CC1Option, FC1Option]>,
   Values<"none,4,5,6">,
   NormalizedValuesScope<"llvm::CodeObjectVersionKind">,
   NormalizedValues<["COV_None", "COV_4", "COV_5", "COV_6"]>,
-  MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_5">;
+  MarshallingInfoEnum<TargetOpts<"CodeObjectVersion">, "COV_6">;
 
 defm cumode : SimpleMFlag<"cumode",
   "Specify CU wavefront", "Specify WGP wavefront",
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 8d977149e62485..4e6ace48c3ffb5 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -2705,7 +2705,7 @@ void tools::checkAMDGPUCodeObjectVersion(const Driver &D,
 
 unsigned tools::getAMDGPUCodeObjectVersion(const Driver &D,
                                            const llvm::opt::ArgList &Args) {
-  unsigned CodeObjVer = 5; // default
+  unsigned CodeObjVer = 6; // default
   if (auto *CodeObjArg = getAMDGPUCodeObjectArgument(D, Args))
     StringRef(CodeObjArg->getValue()).getAsInteger(0, CodeObjVer);
   return CodeObjVer;
diff --git a/clang/test/CodeGen/amdgpu-address-spaces.cpp b/clang/test/CodeGen/amdgpu-address-spaces.cpp
index ae2c61439f4ca5..b121b559f58dc3 100644
--- a/clang/test/CodeGen/amdgpu-address-spaces.cpp
+++ b/clang/test/CodeGen/amdgpu-address-spaces.cpp
@@ -29,7 +29,7 @@ int [[clang::address_space(999)]] bbb = 1234;
 // CHECK: @u = addrspace(5) global i32 undef, align 4
 // CHECK: @aaa = addrspace(6) global i32 1000, align 4
 // CHECK: @bbb = addrspace(999) global i32 1234, align 4
-// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 // CHECK-LABEL: define dso_local amdgpu_kernel void @foo(
 // CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
diff --git a/clang/test/CodeGenCUDA/amdgpu-code-object-version.cu b/clang/test/CodeGenCUDA/amdgpu-code-object-version.cu
index ffe12544917f7f..aa0e3edec3f6a3 100644
--- a/clang/test/CodeGenCUDA/amdgpu-code-object-version.cu
+++ b/clang/test/CodeGenCUDA/amdgpu-code-object-version.cu
@@ -1,7 +1,7 @@
 // Create module flag for code object version.
 
 // RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -emit-llvm \
-// RUN:   -o - %s | FileCheck %s -check-prefix=V5
+// RUN:   -o - %s | FileCheck %s -check-prefix=V6
 
 // RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -emit-llvm \
 // RUN:   -mcode-object-version=4 -o - %s | FileCheck -check-prefix=V4 %s
diff --git a/clang/test/CodeGenCXX/dynamic-cast-address-space.cpp b/clang/test/CodeGenCXX/dynamic-cast-address-space.cpp
index 271d9ede79d0c4..7eebdf68115a98 100644
--- a/clang/test/CodeGenCXX/dynamic-cast-address-space.cpp
+++ b/clang/test/CodeGenCXX/dynamic-cast-address-space.cpp
@@ -13,7 +13,7 @@ B fail;
 // 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
 // CHECK: @_ZTVN10__cxxabiv120__si_class_type_infoE = external addrspace(1) global [0 x ptr addrspace(1)]
 // CHECK: @_ZTS1B = linkonce_odr addrspace(1) constant [3 x i8] c"1B\00", comdat, align 1
-// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 // 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
 // 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) {
 // WITH-NONZERO-DEFAULT-AS: attributes #[[ATTR3]] = { nounwind }
 // WITH-NONZERO-DEFAULT-AS: attributes #[[ATTR4]] = { noreturn }
 //.
-// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // CHECK: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // CHECK: [[META2:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
 //.
-// WITH-NONZERO-DEFAULT-AS: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// WITH-NONZERO-DEFAULT-AS: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // WITH-NONZERO-DEFAULT-AS: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // WITH-NONZERO-DEFAULT-AS: [[META2:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
 //.
diff --git a/clang/test/CodeGenHIP/default-attributes.hip b/clang/test/CodeGenHIP/default-attributes.hip
index 1b53ebec9b5821..f4dbad021987f1 100644
--- a/clang/test/CodeGenHIP/default-attributes.hip
+++ b/clang/test/CodeGenHIP/default-attributes.hip
@@ -8,7 +8,7 @@
 //.
 // 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"
-// OPTNONE: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// OPTNONE: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 __device__ void extern_func();
 
@@ -39,7 +39,7 @@ __global__ void kernel() {
 // 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 500}
+// 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}
 //.
diff --git a/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl b/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
index 62b5661da9dbd8..7f2a17b6ef8c55 100644
--- a/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
+++ b/clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
@@ -62,7 +62,7 @@ kernel void test_target_features_kernel(global int *i) {
 
 //.
 // 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
-// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 // NOCPU: Function Attrs: convergent noinline norecurse nounwind optnone
 // NOCPU-LABEL: define {{[^@]+}}@callee
@@ -759,7 +759,7 @@ kernel void test_target_features_kernel(global int *i) {
 // GFX900: attributes #[[ATTR8]] = { nounwind }
 // GFX900: attributes #[[ATTR9]] = { convergent nounwind }
 //.
-// NOCPU: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// NOCPU: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // NOCPU: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // NOCPU: [[META2:![0-9]+]] = !{i32 2, i32 0}
 // NOCPU: [[META3]] = !{i32 1, i32 0, i32 1, i32 0}
@@ -777,7 +777,7 @@ kernel void test_target_features_kernel(global int *i) {
 // NOCPU: [[META15]] = !{i32 1}
 // NOCPU: [[META16]] = !{!"int*"}
 //.
-// GFX900: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// GFX900: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // GFX900: [[META1:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // GFX900: [[META2:![0-9]+]] = !{i32 2, i32 0}
 // GFX900: [[TBAA3]] = !{[[META4:![0-9]+]], [[META4]], i64 0}
diff --git a/clang/test/Driver/Inputs/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z/amdgcn/bitcode/oclc_abi_version_600.bc b/clang/test/Driver/Inputs/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z/amdgcn/bitcode/oclc_abi_version_600.bc
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/clang/test/Driver/Inputs/rocm_resource_dir/lib/amdgcn/bitcode/oclc_abi_version_600.bc b/clang/test/Driver/Inputs/rocm_resource_dir/lib/amdgcn/bitcode/oclc_abi_version_600.bc
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/clang/test/Driver/Inputs/rocm_resource_dir/lib64/amdgcn/bitcode/oclc_abi_version_600.bc b/clang/test/Driver/Inputs/rocm_resource_dir/lib64/amdgcn/bitcode/oclc_abi_version_600.bc
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/clang/test/Driver/hip-device-libs.hip b/clang/test/Driver/hip-device-libs.hip
index 6f1d31508e3302..3ae384cf05d972 100644
--- a/clang/test/Driver/hip-device-libs.hip
+++ b/clang/test/Driver/hip-device-libs.hip
@@ -157,7 +157,7 @@
 // Test default code object version.
 // RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \
 // RUN:   --rocm-path=%S/Inputs/rocm %S/Inputs/hip_multiple_inputs/b.hip \
-// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI5
+// RUN: 2>&1 | FileCheck %s --check-prefixes=ABI6
 
 // Test default code object version with old device library without abi_version_400.bc
 // RUN: %clang -### --target=x86_64-linux-gnu --offload-arch=gfx900 \
diff --git a/clang/test/OpenMP/amdgcn_target_global_constructor.cpp b/clang/test/OpenMP/amdgcn_target_global_constructor.cpp
index 9f1e68d4ea0fec..d728dc1233e2c7 100644
--- a/clang/test/OpenMP/amdgcn_target_global_constructor.cpp
+++ b/clang/test/OpenMP/amdgcn_target_global_constructor.cpp
@@ -29,7 +29,7 @@ S A;
 // CHECK: @A = addrspace(1) global %struct.S zeroinitializer, align 4
 // 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 }]
 // CHECK: @llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @__dtor_A, ptr null }]
-// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 600
 //.
 // CHECK-LABEL: define {{[^@]+}}@__cxx_global_var_init
 // CHECK-SAME: () #[[ATTR0:[0-9]+]] {
@@ -104,7 +104,7 @@ S A;
 // CHECK: attributes #[[ATTR4]] = { convergent nounwind }
 //.
 // CHECK: [[META0:![0-9]+]] = !{i32 1, !"A", i32 0, i32 0}
-// CHECK: [[META1:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 500}
+// CHECK: [[META1:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600}
 // CHECK: [[META2:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
 // CHECK: [[META3:![0-9]+]] = !{i32 7, !"openmp", i32 51}
 // CHECK: [[META4:![0-9]+]] = !{i32 7, !"openmp-device", i32 51}
diff --git a/offload/plugins-nextgen/common/src/Utils/ELF.cpp b/offload/plugins-nextgen/common/src/Utils/ELF.cpp
index 88642fd5b56400..18b5ad3351b12d 100644
--- a/offload/plugins-nextgen/common/src/Utils/ELF.cpp
+++ b/offload/plugins-nextgen/common/src/Utils/ELF.cpp
@@ -64,8 +64,9 @@ checkMachineImpl(const object::ELFObjectFile<ELFT> &ELFObj, uint16_t EMachine) {
     if (Header.e_ident[EI_OSABI] != ELFOSABI_AMDGPU_HSA)
       return createError("Invalid AMD OS/ABI, must be AMDGPU_HSA");
     if (Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V4 &&
-        Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V5)
-      return createError("Invalid AMD ABI version, must be version 4 or 5");
+        Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V5 &&
+        Header.e_ident[EI_ABIVERSION] != ELFABIVERSION_AMDGPU_HSA_V6)
+      return createError("Invalid AMD ABI version, must be version above 4");
     if ((Header.e_flags & EF_AMDGPU_MACH) < EF_AMDGPU_MACH_AMDGCN_GFX700 ||
         (Header.e_flags & EF_AMDGPU_MACH) > EF_AMDGPU_MACH_AMDGCN_GFX1201)
       return createError("Unsupported AMDGPU architecture");

@shiltian
Copy link
Contributor Author

shiltian commented Dec 3, 2024

@jplehr @ronlieb A heads-up for OpenMP folks. This change might be intrusive.

Copy link
Contributor

@jhuber6 jhuber6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does V6 have any nasty runtime changes associated with it? Or is it just recognizing the generic targets.

@shiltian shiltian requested a review from kzhuravl December 3, 2024 17:11
@shiltian
Copy link
Contributor Author

shiltian commented Dec 3, 2024

AFAIK it has nothing fancy for runtime.

@shiltian shiltian force-pushed the users/shiltian/cov6-by-default branch from 537c973 to 169b95d Compare December 3, 2024 17:13
@jhuber6
Copy link
Contributor

jhuber6 commented Dec 3, 2024

AFAIK it has nothing fancy for runtime.

The libc CMake has a variable that sets it to 5, might be worth bumping that up since it's actively tested. It's in the prepare_libc_gpu_build.cmake.

@shiltian
Copy link
Contributor Author

shiltian commented Dec 3, 2024

AFAIK it has nothing fancy for runtime.

The libc CMake has a variable that sets it to 5, might be worth bumping that up since it's actively tested. It's in the prepare_libc_gpu_build.cmake.

Done.

@shiltian shiltian force-pushed the users/shiltian/cov6-by-default branch from 169b95d to 57fa521 Compare December 3, 2024 17:17
@llvmbot llvmbot added the libc label Dec 3, 2024
@shiltian shiltian force-pushed the users/shiltian/cov6-by-default branch 2 times, most recently from dc6f54c to 88df866 Compare December 3, 2024 17:27
Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the clang default only, and not the backend?

@shiltian shiltian force-pushed the users/shiltian/cov6-by-default branch from 88df866 to a0dfb34 Compare December 3, 2024 21:54
@shiltian
Copy link
Contributor Author

shiltian commented Dec 3, 2024

Why change the clang default only, and not the backend?

Yeah, initially I thought that was dictated by the front end but forgot we could invoke directly via opt, llc, etc. Done.

@shiltian shiltian force-pushed the users/shiltian/cov6-by-default branch from a0dfb34 to af3d46f Compare December 3, 2024 23:10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we have no other tests checking this field, which seems hard to believe. We probably should have one that tests it with explicit flags etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have multiple tests that have explicit module flag and checks for the match.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git grep "\.amdhsa_code_object_version" llvm/test/CodeGen/AMDGPU/ does not find them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, they check the IR match Lol. I will add one later then.

@shiltian shiltian force-pushed the users/shiltian/cov6-by-default branch from af3d46f to 8ba9407 Compare December 3, 2024 23:17
@shiltian shiltian merged commit 410cbe3 into main Dec 4, 2024
9 checks passed
@shiltian shiltian deleted the users/shiltian/cov6-by-default branch December 4, 2024 00:38
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 4, 2024

LLVM Buildbot has detected a new failure on builder clang-hip-vega20 running on hip-vega20-0 while building clang,libc,llvm,offload at step 3 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/10534

Here is the relevant piece of the build log for the reference
Step 3 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/hip-build.sh --jobs=' (failure)
...
[20/38] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/litsupport && /usr/local/bin/cmake -E copy /buildbot/llvm-test-suite/litsupport/testplan.py /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/litsupport/testplan.py
[21/38] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time -MD -MT tools/CMakeFiles/timeit-target.dir/timeit.c.o -MF tools/CMakeFiles/timeit-target.dir/timeit.c.o.d -o tools/CMakeFiles/timeit-target.dir/timeit.c.o -c /buildbot/llvm-test-suite/tools/timeit.c
[22/38] : && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang -O3 -DNDEBUG  tools/CMakeFiles/timeit-target.dir/timeit.c.o -o tools/timeit-target   && :
[23/38] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time -MD -MT tools/CMakeFiles/fpcmp-target.dir/fpcmp.c.o -MF tools/CMakeFiles/fpcmp-target.dir/fpcmp.c.o.d -o tools/CMakeFiles/fpcmp-target.dir/fpcmp.c.o -c /buildbot/llvm-test-suite/tools/fpcmp.c
[24/38] : && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang -O3 -DNDEBUG  tools/CMakeFiles/fpcmp-target.dir/fpcmp.c.o -o tools/fpcmp-target   && :
[25/38] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools && cc -c /buildbot/llvm-test-suite/tools/timeit.c -o /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit.c.o
[26/38] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools && cc -c /buildbot/llvm-test-suite/tools/fpcmp.c -o /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp.c.o
[27/38] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools && cc /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp.c.o -o /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp
[28/38] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools && cc /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit.c.o -o /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit
[29/38] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -xhip -mfma -MD -MT External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -MF External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o.d -o External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -c /buildbot/llvm-test-suite/External/HIP/workload/ray-tracing/TheNextWeek/main.cc
FAILED: External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o 
/buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -xhip -mfma -MD -MT External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -MF External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o.d -o External/HIP/CMakeFiles/TheNextWeek-hip-6.0.2.dir/workload/ray-tracing/TheNextWeek/main.cc.o -c /buildbot/llvm-test-suite/External/HIP/workload/ray-tracing/TheNextWeek/main.cc
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
[30/38] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -MD -MT External/HIP/CMakeFiles/memmove-hip-6.0.2.dir/memmove.hip.o -MF External/HIP/CMakeFiles/memmove-hip-6.0.2.dir/memmove.hip.o.d -o External/HIP/CMakeFiles/memmove-hip-6.0.2.dir/memmove.hip.o -c /buildbot/llvm-test-suite/External/HIP/memmove.hip
FAILED: External/HIP/CMakeFiles/memmove-hip-6.0.2.dir/memmove.hip.o 
/buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -MD -MT External/HIP/CMakeFiles/memmove-hip-6.0.2.dir/memmove.hip.o -MF External/HIP/CMakeFiles/memmove-hip-6.0.2.dir/memmove.hip.o.d -o External/HIP/CMakeFiles/memmove-hip-6.0.2.dir/memmove.hip.o -c /buildbot/llvm-test-suite/External/HIP/memmove.hip
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
[31/38] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -fopenmp -MD -MT External/HIP/CMakeFiles/with-fopenmp-hip-6.0.2.dir/with-fopenmp.hip.o -MF External/HIP/CMakeFiles/with-fopenmp-hip-6.0.2.dir/with-fopenmp.hip.o.d -o External/HIP/CMakeFiles/with-fopenmp-hip-6.0.2.dir/with-fopenmp.hip.o -c /buildbot/llvm-test-suite/External/HIP/with-fopenmp.hip
FAILED: External/HIP/CMakeFiles/with-fopenmp-hip-6.0.2.dir/with-fopenmp.hip.o 
/buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -fopenmp -MD -MT External/HIP/CMakeFiles/with-fopenmp-hip-6.0.2.dir/with-fopenmp.hip.o -MF External/HIP/CMakeFiles/with-fopenmp-hip-6.0.2.dir/with-fopenmp.hip.o.d -o External/HIP/CMakeFiles/with-fopenmp-hip-6.0.2.dir/with-fopenmp.hip.o -c /buildbot/llvm-test-suite/External/HIP/with-fopenmp.hip
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
[32/38] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -MD -MT External/HIP/CMakeFiles/saxpy-hip-6.0.2.dir/saxpy.hip.o -MF External/HIP/CMakeFiles/saxpy-hip-6.0.2.dir/saxpy.hip.o.d -o External/HIP/CMakeFiles/saxpy-hip-6.0.2.dir/saxpy.hip.o -c /buildbot/llvm-test-suite/External/HIP/saxpy.hip
FAILED: External/HIP/CMakeFiles/saxpy-hip-6.0.2.dir/saxpy.hip.o 
/buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -MD -MT External/HIP/CMakeFiles/saxpy-hip-6.0.2.dir/saxpy.hip.o -MF External/HIP/CMakeFiles/saxpy-hip-6.0.2.dir/saxpy.hip.o.d -o External/HIP/CMakeFiles/saxpy-hip-6.0.2.dir/saxpy.hip.o -c /buildbot/llvm-test-suite/External/HIP/saxpy.hip
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
[33/38] /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -MD -MT External/HIP/CMakeFiles/empty-hip-6.0.2.dir/empty.hip.o -MF External/HIP/CMakeFiles/empty-hip-6.0.2.dir/empty.hip.o.d -o External/HIP/CMakeFiles/empty-hip-6.0.2.dir/empty.hip.o -c /buildbot/llvm-test-suite/External/HIP/empty.hip
FAILED: External/HIP/CMakeFiles/empty-hip-6.0.2.dir/empty.hip.o 
/buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/clang++ -DNDEBUG  -O3 -DNDEBUG   -w -Werror=date-time --rocm-path=/buildbot/Externals/hip/rocm-6.0.2 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx1030 --offload-arch=gfx1100 -MD -MT External/HIP/CMakeFiles/empty-hip-6.0.2.dir/empty.hip.o -MF External/HIP/CMakeFiles/empty-hip-6.0.2.dir/empty.hip.o.d -o External/HIP/CMakeFiles/empty-hip-6.0.2.dir/empty.hip.o -c /buildbot/llvm-test-suite/External/HIP/empty.hip
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
clang++: error: cannot find ROCm device libraryfor ABI version 6; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library
ninja: build stopped: subcommand failed.
Step 8 (Install LLVM) failure: Install LLVM
...
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/TargetParser/ARMTargetParserDef.inc
-- Up-to-date: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicEnums.inc
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsX86.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsRISCV.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsS390.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsNVPTX.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsPowerPC.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsBPF.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsR600.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsHexagon.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsARM.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsLoongArch.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsMips.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsXCore.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsDirectX.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsAArch64.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsAMDGPU.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicImpl.inc
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsSPIRV.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsWebAssembly.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/IntrinsicsVE.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/IR/Attributes.inc
-- Up-to-date: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Config
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Config/Targets.def
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Config/llvm-config.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Config/Disassemblers.def
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Config/TargetMCAs.def
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Config/AsmPrinters.def
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Config/abi-breaking.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Config/AsmParsers.def
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Config/TargetExegesis.def
-- Up-to-date: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Frontend
-- Up-to-date: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Frontend/OpenACC
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Frontend/OpenACC/ACC.h.inc
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Frontend/OpenACC/ACC.inc
-- Up-to-date: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Frontend/OpenMP
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Frontend/OpenMP/OMP.h.inc
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Frontend/OpenMP/OMP.inc
-- Up-to-date: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Support
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Support/VCSRevision.h
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/Support/Extension.def
-- Up-to-date: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/CodeGen
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/include/llvm/CodeGen/GenVT.inc
-- Installing: /buildbot/hip-vega20-0/clang-hip-vega20/install/lib/cmake/llvm/LLVMConfigExtensions.cmake
+ update_test_suite
+ '[' '!' -d /buildbot/llvm-test-suite ']'
+ build_step 'Updating llvm-test-suite repo'
+ echo '@@@BUILD_STEP Updating llvm-test-suite repo@@@'
+ git -C /buildbot/llvm-test-suite fetch origin

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 4, 2024

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime running on omp-vega20-0 while building clang,libc,llvm,offload at step 7 "Add check check-offload".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/30/builds/11492

Here is the relevant piece of the build log for the reference
Step 7 (Add check check-offload) failure: test (failure)
******************** TEST 'libomptarget :: amdgcn-amd-amdhsa :: api/omp_device_managed_memory_alloc.c' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/clang -fopenmp    -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/api/omp_device_managed_memory_alloc.c -o /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/api/Output/omp_device_managed_memory_alloc.c.tmp /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a && /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/api/Output/omp_device_managed_memory_alloc.c.tmp | /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/api/omp_device_managed_memory_alloc.c
# executed command: /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/clang -fopenmp -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/api/omp_device_managed_memory_alloc.c -o /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/api/Output/omp_device_managed_memory_alloc.c.tmp /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a
# note: command had no output on stdout or stderr
# executed command: /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/api/Output/omp_device_managed_memory_alloc.c.tmp
# .---command stderr------------
# | "PluginInterface" error: Failure to load binary image 0x561aefd746c0 on device 0: Error in hsa_executable_load_agent_code_object: HSA_STATUS_ERROR_INVALID_CODE_OBJECT: The code object is invalid.
# | omptarget error: Failed to load image Failed to load binary 0x561aefd746c0
# | omptarget fatal error 0: Failed to load images on device '0'
# `-----------------------------
# error: command failed with exit status: -6
# executed command: /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/api/omp_device_managed_memory_alloc.c
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/api/omp_device_managed_memory_alloc.c
# `-----------------------------
# error: command failed with exit status: 2

--

********************


@shiltian
Copy link
Contributor Author

shiltian commented Dec 4, 2024

The OpenMP failure has nothing to do with this PR. Please update ROCm to a version that supports COV6.

@ronlieb @jplehr

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 4, 2024

LLVM Buildbot has detected a new failure on builder openmp-offload-libc-amdgpu-runtime running on omp-vega20-1 while building clang,libc,llvm,offload at step 7 "Add check check-offload".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/9555

Here is the relevant piece of the build log for the reference
Step 7 (Add check check-offload) failure: test (failure)
******************** TEST 'libomptarget :: amdgcn-amd-amdhsa :: api/ompx_sync.c' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp    -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/api/ompx_sync.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/api/Output/ompx_sync.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a && /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/api/Output/ompx_sync.c.tmp | /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/api/ompx_sync.c
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/clang -fopenmp -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/api/ompx_sync.c -o /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/api/Output/ompx_sync.c.tmp -Xoffload-linker -lc -Xoffload-linker -lm /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/api/Output/ompx_sync.c.tmp
# .---command stderr------------
# | "PluginInterface" error: Failure to load binary image 0x5638f6881620 on device 0: Error in hsa_executable_load_agent_code_object: HSA_STATUS_ERROR_INVALID_CODE_OBJECT: The code object is invalid.
# | omptarget error: Failed to load image Failed to load binary 0x5638f6881620
# | omptarget fatal error 0: Failed to load images on device '0'
# `-----------------------------
# error: command failed with exit status: -6
# executed command: /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/api/ompx_sync.c
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/offload/test/api/ompx_sync.c
# `-----------------------------
# error: command failed with exit status: 2

--

********************

Step 8 (Add check check-libc-amdgcn-amd-amdhsa) failure: test (failure)
...
[1578/2684] Linking CXX executable libc/test/integration/startup/gpu/libc.test.integration.startup.gpu.startup_args_test.__build__
[1579/2684] Building CXX object libc/test/integration/startup/gpu/CMakeFiles/libc.test.integration.startup.gpu.startup_rpc_stream_test.__build__.dir/rpc_stream_test.cpp.o
clang++: warning: code object v6 is still in development and not ready for production use yet; use at your own risk
[1580/2684] Building CXX object libc/test/src/inttypes/CMakeFiles/libc.test.src.inttypes.strtoumax_test.__hermetic__.__build__.dir/strtoumax_test.cpp.o
clang++: warning: code object v6 is still in development and not ready for production use yet; use at your own risk
[1581/2684] Linking CXX executable libc/test/integration/startup/gpu/libc.test.integration.startup.gpu.init_fini_array_test.__build__
[1582/2684] Building CXX object libc/test/src/inttypes/CMakeFiles/libc.test.src.inttypes.strtoimax_test.__hermetic__.__build__.dir/strtoimax_test.cpp.o
clang++: warning: code object v6 is still in development and not ready for production use yet; use at your own risk
[1583/2684] Linking CXX executable libc/test/integration/src/stdio/libc.test.integration.src.stdio.sprintf_size_test_no_sprintf.__build__
[1584/2684] Running integration test libc.test.integration.startup.gpu.startup_args_test
FAILED: libc/test/integration/startup/gpu/CMakeFiles/libc.test.integration.startup.gpu.startup_args_test /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/test/integration/startup/gpu/CMakeFiles/libc.test.integration.startup.gpu.startup_args_test 
cd /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/test/integration/startup/gpu && FRANCE=Paris GERMANY=Berlin /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/bin/amdhsa-loader /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/test/integration/startup/gpu/libc.test.integration.startup.gpu.startup_args_test.__build__ 1 2 3
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/utils/gpu/loader/amdgpu/amdhsa-loader.cpp:383:0: Error: HSA_STATUS_ERROR_INVALID_CODE_OBJECT: The code object is invalid.
[1585/2684] Linking CXX executable libc/test/integration/startup/gpu/libc.test.integration.startup.gpu.startup_rpc_test.__build__
[1586/2684] Running integration test libc.test.integration.startup.gpu.init_fini_array_test
FAILED: libc/test/integration/startup/gpu/CMakeFiles/libc.test.integration.startup.gpu.init_fini_array_test /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/test/integration/startup/gpu/CMakeFiles/libc.test.integration.startup.gpu.init_fini_array_test 
cd /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/test/integration/startup/gpu && /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/bin/amdhsa-loader /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/test/integration/startup/gpu/libc.test.integration.startup.gpu.init_fini_array_test.__build__
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/utils/gpu/loader/amdgpu/amdhsa-loader.cpp:383:0: Error: HSA_STATUS_ERROR_INVALID_CODE_OBJECT: The code object is invalid.
[1587/2684] Running integration test libc.test.integration.src.stdio.sprintf_size_test_no_sprintf
FAILED: libc/test/integration/src/stdio/CMakeFiles/libc.test.integration.src.stdio.sprintf_size_test_no_sprintf /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/test/integration/src/stdio/CMakeFiles/libc.test.integration.src.stdio.sprintf_size_test_no_sprintf 
cd /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/test/integration/src/stdio && /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/bin/amdhsa-loader /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/libc/test/integration/src/stdio/libc.test.integration.src.stdio.sprintf_size_test_no_sprintf.__build__ %s\ %c\ %d First\ arg a 0
/home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.src/libc/utils/gpu/loader/amdgpu/amdhsa-loader.cpp:383:0: Error: HSA_STATUS_ERROR_INVALID_CODE_OBJECT: The code object is invalid.
[1588/2684] Linking CXX executable libc/test/integration/startup/gpu/libc.test.integration.startup.gpu.startup_rpc_interface_test.__build__
[1589/2684] Building CXX object libc/test/include/CMakeFiles/libc.test.include.sys_queue_test.__hermetic__.__build__.dir/sys/queue_test.cpp.o
clang++: warning: code object v6 is still in development and not ready for production use yet; use at your own risk
[1590/2684] Linking CXX executable libc/test/integration/startup/gpu/libc.test.integration.startup.gpu.startup_rpc_lane_test_w32.__build__
[1591/2684] Linking CXX executable libc/test/integration/startup/gpu/libc.test.integration.startup.gpu.startup_rpc_lane_test_w64.__build__
[1592/2684] Linking CXX executable libc/test/integration/src/stdlib/libc.test.integration.src.stdlib.getenv_test.__build__
[1593/2684] Building CXX object libc/test/src/stdlib/CMakeFiles/libc.test.src.stdlib.strtoint32_test.__hermetic__.__build__.dir/strtoint32_test.cpp.o
clang++: warning: code object v6 is still in development and not ready for production use yet; use at your own risk
[1594/2684] Linking CXX executable libc/test/integration/src/__support/GPU/libc.test.integration.src.__support.GPU.scan_reduce_test.__build__
[1595/2684] Building CXX object libc/test/include/CMakeFiles/libc.test.include.complex_test.__hermetic__.__build__.dir/complex_test.cpp.o
clang++: warning: code object v6 is still in development and not ready for production use yet; use at your own risk
[1596/2684] Linking CXX executable libc/test/integration/startup/gpu/libc.test.integration.startup.gpu.startup_rpc_stream_test.__build__
[1597/2684] Building CXX object libc/test/src/stdlib/CMakeFiles/libc.test.src.stdlib.strtoint64_test.__hermetic__.__build__.dir/strtoint64_test.cpp.o
clang++: warning: code object v6 is still in development and not ready for production use yet; use at your own risk
[1598/2684] Building CXX object libc/test/UnitTest/CMakeFiles/LibcTest.hermetic.dir/LibcTest.cpp.o
clang++: warning: code object v6 is still in development and not ready for production use yet; use at your own risk
[1599/2684] Linking CXX executable libc/test/integration/src/stdio/gpu/libc.test.integration.src.stdio.gpu.printf_test.__build__
ninja: build stopped: subcommand failed.
FAILED: runtimes/CMakeFiles/check-libc-amdgcn-amd-amdhsa /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/CMakeFiles/check-libc-amdgcn-amd-amdhsa 
cd /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins && /usr/local/cmake/bin/cmake --build /home/ompworker/bbot/openmp-offload-libc-amdgpu-runtime/llvm.build/runtimes/runtimes-amdgcn-amd-amdhsa-bins/ --target check-libc --config Release
ninja: build stopped: subcommand failed.

shiltian added a commit that referenced this pull request Dec 4, 2024
This reverts commit 410cbe3 because some
buildbots are not ready yet.
@Pierre-vh
Copy link
Contributor

@shiltian Please also remove warn_drv_amdgpu_cov6 - it's a warning I added while v6 was being worked on.
Now that it's supported by the stack we can remove it.

qiaojbao pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Dec 23, 2024
Local branch amd-gfx fe02a55 Merged main:384562495bae into amd-gfx:401ed9d8228d
Remote branch main 68bcba6 Revert "[AMDGPU] Use COV6 by default (llvm#118515)"
shiltian added a commit that referenced this pull request Mar 12, 2025
shiltian added a commit that referenced this pull request Mar 19, 2025
shiltian added a commit that referenced this pull request Mar 21, 2025
shiltian added a commit that referenced this pull request Mar 21, 2025
@krzysz00
Copy link
Contributor

@shiltian Could you update MLIR infrastructure for the new default as well? mlir/lib/Target/LLVM/ROCDL/Target.cpp and mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp, which both keep an ear on the ABI version, partly for linking in device libraries

@shiltian
Copy link
Contributor Author

shiltian commented Apr 1, 2025

@shiltian Could you update MLIR infrastructure for the new default as well? mlir/lib/Target/LLVM/ROCDL/Target.cpp and mlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp, which both keep an ear on the ABI version, partly for linking in device libraries

#133849

@JonChesterfield
Copy link
Collaborator

JonChesterfield commented Aug 10, 2025

Do we document what rocm version introduces support for a given code object number anywhere?

I've run into this because Debian's latest and greatest version is 6.1, https://packages.debian.org/sid/libhsa-runtime-dev, which does not know what v6 is. Or at least refuses to run objects with that number in the header.

Found it in clang/docs/ReleaseNotes.rst, i.e. clang's release notes. Not in AMD's docs though. 6.3, which is not packaged.

I think we should have waited to bump the default version until the result could be run on ubuntu, though I've found an unrelated report about rocm stuff not working on arch which suggests they're already on 6.3 (https://gitlab.archlinux.org/archlinux/packaging/packages/clang/-/issues/10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:AMDGPU clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang:openmp OpenMP related changes to Clang clang Clang issues not falling into any other category libc offload

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants