Skip to content

Commit 096eba1

Browse files
authored
[TargetParser][AMDGPU] Fix getArchEntry(). (llvm#69222)
It's supposed to return null when an unknown target id is passed.
1 parent bff17f9 commit 096eba1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/TargetParser/TargetParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const GPUInfo *getArchEntry(AMDGPU::GPUKind AK, ArrayRef<GPUInfo> Table) {
133133
return A.Kind < B.Kind;
134134
});
135135

136-
if (I == Table.end())
136+
if (I == Table.end() || I->Kind != Search.Kind)
137137
return nullptr;
138138
return I;
139139
}

0 commit comments

Comments
 (0)