Skip to content

Commit

Permalink
Additional reverse mapping of SC to AMDGCN AS.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVlx committed Nov 17, 2024
1 parent e2b5d99 commit 2b55e1d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/SPIRV/SPIRVReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3552,8 +3552,11 @@ Instruction *SPIRVToLLVM::transBuiltinFromInst(const std::string &FuncName,
auto *AI = static_cast<SPIRVAtomicInstBase *>(BI);
ArgTys[Ptr] = TypedPointerType::get(
transType(AI->getSemanticType()),
SPIRSPIRVAddrSpaceMap::rmap(
BI->getValueType(Ops[Ptr]->getId())->getPointerStorageClass()));
M->getTargetTriple() == "amdgcn-amd-amdhsa"
? mapSPIRVAddrSpaceToAMDGPU(
BI->getValueType(Ops[Ptr]->getId())->getPointerStorageClass())
: SPIRSPIRVAddrSpaceMap::rmap(
BI->getValueType(Ops[Ptr]->getId())->getPointerStorageClass()));
}
}

Expand Down Expand Up @@ -5359,7 +5362,9 @@ Instruction *SPIRVToLLVM::transOCLBuiltinFromExtInst(SPIRVExtInst *BC,
auto *BVar = static_cast<SPIRVUntypedVariableKHR *>(BC->getArgValue(I));
ArgTypes[I] = TypedPointerType::get(
transType(BVar->getDataType()),
SPIRSPIRVAddrSpaceMap::rmap(BVar->getStorageClass()));
(M->getTargetTriple() == "amdgcn-amd-amdhsa")
? mapSPIRVAddrSpaceToAMDGPU(BVar->getStorageClass())
: SPIRSPIRVAddrSpaceMap::rmap(BVar->getStorageClass()));
}
}

Expand Down

0 comments on commit 2b55e1d

Please sign in to comment.