Skip to content

Commit 3246e45

Browse files
authored
[Comgr] Handle amdgcnspirv when used as an ISA name
1 parent 73694ef commit 3246e45

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

amd/comgr/src/comgr.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,16 @@ amd_comgr_status_t COMGR::parseTargetIdentifier(StringRef IdentStr,
308308
Ident.Processor = Ident.Features[0];
309309
Ident.Features.erase(Ident.Features.begin());
310310

311-
size_t IsaIndex;
312311

312+
// TODO: Add a LIT test for this
313+
if (IdentStr == "amdgcn-amd-amdhsa--amdgcnspirv") {
314+
// Features not supported for SPIR-V
315+
if (!Ident.Features.empty())
316+
return AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT;
317+
return AMD_COMGR_STATUS_SUCCESS;
318+
}
319+
320+
size_t IsaIndex;
313321
amd_comgr_status_t Status = metadata::getIsaIndex(IdentStr, IsaIndex);
314322
if (Status != AMD_COMGR_STATUS_SUCCESS) {
315323
return Status;
@@ -981,6 +989,10 @@ amd_comgr_status_t AMD_COMGR_API
981989
return AMD_COMGR_STATUS_SUCCESS;
982990
}
983991

992+
if (StringRef(IsaName) == "amdgcn-amd-amdhsa--amdgcnspirv") {
993+
return ActionP->setIsaName(IsaName);
994+
}
995+
984996
if (!metadata::isValidIsaName(IsaName)) {
985997
return AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT;
986998
}

0 commit comments

Comments
 (0)