[llvm] 607b4bc - [AMDGPU] Add a missing COV6 case to getAMDHSACodeObjectVersion() (#87492)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 3 12:37:02 PDT 2024
Author: Emma Pilkington
Date: 2024-04-03T15:36:58-04:00
New Revision: 607b4bc602eda79e97a91a9bc3552a6004e5ac47
URL: https://github.com/llvm/llvm-project/commit/607b4bc602eda79e97a91a9bc3552a6004e5ac47
DIFF: https://github.com/llvm/llvm-project/commit/607b4bc602eda79e97a91a9bc3552a6004e5ac47.diff
LOG: [AMDGPU] Add a missing COV6 case to getAMDHSACodeObjectVersion() (#87492)
Added:
Modified:
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
llvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-cov5.s
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
index 4b743762fd78d0..4e0074451aa58c 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
@@ -182,6 +182,8 @@ unsigned getAMDHSACodeObjectVersion(unsigned ABIVersion) {
return 4;
case ELF::ELFABIVERSION_AMDGPU_HSA_V5:
return 5;
+ case ELF::ELFABIVERSION_AMDGPU_HSA_V6:
+ return 6;
default:
return getDefaultAMDHSACodeObjectVersion();
}
diff --git a/llvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-cov5.s b/llvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-cov5.s
index ece36c6ad2672e..5600bcdeb1c625 100644
--- a/llvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-cov5.s
+++ b/llvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-cov5.s
@@ -6,6 +6,13 @@
; RUN: | llvm-mc --triple=amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=-xnack,+wavefrontsize32,-wavefrontsize64 -filetype=obj > %t.o
; RUN: llvm-objdump --disassemble-symbols=kernel.kd %t.o | FileCheck %s --check-prefixes=COV4,CHECK
+;; Make sure we override the default COV in the disassembler on COV6 (there
+;; currently aren't any
diff erences between 5 and 6, so set the default to 4 so
+;; we can verify that the default is at least overridden)
+; RUN: sed 's/CODE_OBJECT_VERSION/6/g' %s \
+; RUN: | llvm-mc --triple=amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=-xnack,+wavefrontsize32,-wavefrontsize64 -filetype=obj > %t.o
+; RUN: llvm-objdump -mllvm --amdhsa-code-object-version=4 --disassemble-symbols=kernel.kd %t.o | FileCheck %s --check-prefixes=COV5,CHECK
+
;; Verify that .amdhsa_uses_dynamic_stack is only printed on COV5+.
; CHECK: .amdhsa_kernel kernel
More information about the llvm-commits
mailing list