[flang-commits] [clang] [flang] [lld] [lldb] [llvm] AMDGPU: Introduce amdgpu triple arch (PR #206480)
Scott Linder via flang-commits
flang-commits at lists.llvm.org
Tue Jul 7 08:51:41 PDT 2026
================
@@ -873,6 +879,24 @@ AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, const Triple &TT,
TLOF(createTLOF(getTargetTriple())) {
initAsmInfo();
if (TT.isAMDGCN()) {
+ // Triple is missing a representation for non-empty, but unrecognized
+ // subarches. Only permit no subarch for any subtarget if it was really
+ // empty.
+ bool IsUnknownSubArch =
+ TT.getSubArch() == Triple::NoSubArch && TT.getArchName().size() != 6;
+ if (IsUnknownSubArch)
+ reportFatalUsageError("unknown subarch " + TT.getArchName());
+
+ if (TT.getSubArch() != Triple::NoSubArch) {
+ AMDGPU::GPUKind Kind = AMDGPU::parseArchAMDGCN(CPU);
+ Triple::SubArchType GPUSubArch = AMDGPU::getSubArch(Kind);
+ if (Kind != AMDGPU::GK_NONE && GPUSubArch != TT.getSubArch() &&
+ TT.getSubArch() != AMDGPU::getMajorSubArch(GPUSubArch)) {
----------------
slinder1 wrote:
Is that something we can "fix" with the switch to the new architecture? It would require adding `Legacy` variants of things like `parseArchAMDGCN`, but then in the "correct" versions we could add `.Case("", AMDGPU::GPUKind::GK_EMPTY)` or something to differentiate the case?
https://github.com/llvm/llvm-project/pull/206480
More information about the flang-commits
mailing list