diff --git a/llvm/lib/TargetParser/TargetParser.cpp b/llvm/lib/TargetParser/TargetParser.cpp index fb7ede1b37e60..8ab48825d1b96 100644 --- a/llvm/lib/TargetParser/TargetParser.cpp +++ b/llvm/lib/TargetParser/TargetParser.cpp @@ -133,7 +133,7 @@ const GPUInfo *getArchEntry(AMDGPU::GPUKind AK, ArrayRef Table) { return A.Kind < B.Kind; }); - if (I == Table.end()) + if (I == Table.end() || I->Kind != Search.Kind) return nullptr; return I; }