Skip to content

Commit

Permalink
[TargetParser][AMDGPU] Fix getArchEntry(). (#69222)
Browse files Browse the repository at this point in the history
It's supposed to return null when an unknown target id is passed.
  • Loading branch information
kosarev committed Oct 17, 2023
1 parent bff17f9 commit 096eba1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/TargetParser/TargetParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 096eba1

Please sign in to comment.