Skip to content

Commit

Permalink
Casts to / from the constant AS to the generic AS are legal for AMDGCN.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVlx committed Nov 26, 2024
1 parent 108a41f commit cb97d6e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/SPIRV/SPIRVWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1647,9 +1647,10 @@ SPIRVValue *LLVMToSPIRVBase::transUnaryInst(UnaryInstruction *U,
SrcAddrSpace == SPIRAS_Generic, SPIRVEC_InvalidModule, U,
"Casts from private/local/global address space are allowed only to "
"generic\n");
getErrorLog().checkError(
DestAddrSpace != SPIRAS_Constant, SPIRVEC_InvalidModule, U,
"Casts from generic address space to constant are illegal\n");
if (M->getTargetTriple() != "spirv64-amd-amdhsa")
getErrorLog().checkError(
DestAddrSpace != SPIRAS_Constant, SPIRVEC_InvalidModule, U,
"Casts from generic address space to constant are illegal\n");
BOC = OpGenericCastToPtr;
}
} else {
Expand Down

0 comments on commit cb97d6e

Please sign in to comment.