[llvm] 17ecb55 - [AMDGPU] AMDGPUTargetStreamer::getArchNameFromElfMach - use GPUKind::GK_NONE for unknown AMDGPU ElfMach flags
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 31 09:25:15 PDT 2023
Author: Simon Pilgrim
Date: 2023-07-31T17:25:04+01:00
New Revision: 17ecb55da5a0e12c2b2c99377ace9ee9c4a6fa38
URL: https://github.com/llvm/llvm-project/commit/17ecb55da5a0e12c2b2c99377ace9ee9c4a6fa38
DIFF: https://github.com/llvm/llvm-project/commit/17ecb55da5a0e12c2b2c99377ace9ee9c4a6fa38.diff
LOG: [AMDGPU] AMDGPUTargetStreamer::getArchNameFromElfMach - use GPUKind::GK_NONE for unknown AMDGPU ElfMach flags
Avoids issue reported on ea2c159f966b where objects with unknown subtarget ids were causing llvm_unreachable crashes
Added:
Modified:
llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
index 1bd3cdc6780060..b7bbdac58a5c16 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
@@ -67,7 +67,6 @@ StringRef AMDGPUTargetStreamer::getArchNameFromElfMach(unsigned ElfMach) {
AMDGPU::GPUKind AK;
switch (ElfMach) {
- default: llvm_unreachable("Unhandled ELF::EF_AMDGPU type");
case ELF::EF_AMDGPU_MACH_R600_R600: AK = GK_R600; break;
case ELF::EF_AMDGPU_MACH_R600_R630: AK = GK_R630; break;
case ELF::EF_AMDGPU_MACH_R600_RS880: AK = GK_RS880; break;
@@ -127,6 +126,7 @@ StringRef AMDGPUTargetStreamer::getArchNameFromElfMach(unsigned ElfMach) {
case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1150: AK = GK_GFX1150; break;
case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1151: AK = GK_GFX1151; break;
case ELF::EF_AMDGPU_MACH_NONE: AK = GK_NONE; break;
+ default: AK = GK_NONE; break;
}
StringRef GPUName = getArchNameAMDGCN(AK);
More information about the llvm-commits
mailing list