[llvm] [TargetParser][AMDGPU] Fix getArchEntry(). (PR #69222)
Ivan Kosarev via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 16 08:40:44 PDT 2023
https://github.com/kosarev created https://github.com/llvm/llvm-project/pull/69222
It's supposed to return null when an unknown target id is passed.
>From 5e457667f5607c30fdc79ee91187444e5e3f1c94 Mon Sep 17 00:00:00 2001
From: Ivan Kosarev <ivan.kosarev at amd.com>
Date: Mon, 16 Oct 2023 15:40:48 +0100
Subject: [PATCH] [TargetParser][AMDGPU] Fix getArchEntry().
It's supposed to return null when an unknown target id is passed.
---
llvm/lib/TargetParser/TargetParser.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/TargetParser/TargetParser.cpp b/llvm/lib/TargetParser/TargetParser.cpp
index fb7ede1b37e609d..8ab48825d1b96a3 100644
--- a/llvm/lib/TargetParser/TargetParser.cpp
+++ b/llvm/lib/TargetParser/TargetParser.cpp
@@ -133,7 +133,7 @@ const GPUInfo *getArchEntry(AMDGPU::GPUKind AK, ArrayRef<GPUInfo> Table) {
return A.Kind < B.Kind;
});
- if (I == Table.end())
+ if (I == Table.end() || I->Kind != Search.Kind)
return nullptr;
return I;
}
More information about the llvm-commits
mailing list