P4 to Git Change 1221604 by yaxunl@yaxunl_stg_win50 on 2015/12/16 17:19:59
SWDEV-84089 - [SPIRV] github pull request #32 Changes for Clang integration. Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/frontend_clang.cpp#27 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/linker.cpp#136 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/v0_8/if_acl.cpp#89 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm/include/llvm/Support/SPIRV.h#10 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/CMakeLists.txt#16 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/SPIRVWriter.cpp#16 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/SPIRVWriterPass.cpp#1 branch ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/SPIRVWriterPass.h#1 branch ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/build/Makefile.SPIRV#3 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVBasicBlock.cpp#2 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVBasicBlock.h#2 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVDebug.h#3 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVDecorate.cpp#2 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVDecorate.h#6 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVEntry.cpp#5 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVEntry.h#7 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVFunction.cpp#3 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVFunction.h#3 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVInstruction.h#8 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVModule.cpp#13 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVModule.h#7 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVStream.cpp#5 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVStream.h#4 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVUtil.h#4 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/SPIRV/libSPIRV/SPIRVValue.h#4 integrate ... //depot/stg/opencl/drivers/opencl/compiler/llvm/tools/llvm-spirv/llvm-spirv.cpp#10 integrate
このコミットが含まれているのは:
@@ -197,7 +197,8 @@ int amdcl::ClangOCLFrontend::compileCommand(const std::string& src) {
|
||||
}
|
||||
|
||||
if (Options()->oVariables->FEGenSPIRV) {
|
||||
std::ostringstream ss;
|
||||
std::string s;
|
||||
llvm::raw_string_ostream ss(s);
|
||||
std::string err;
|
||||
|
||||
if (Options()->getLLVMArgc()) {
|
||||
|
||||
@@ -504,19 +504,23 @@ checkAndFixAclBinaryTarget(llvm::Module* module, aclBinary* elf,
|
||||
bool
|
||||
translateSpirv(llvm::Module *&M, const std::string &DumpSpirv,
|
||||
const std::string &DumpLlvm){
|
||||
std::stringstream SS;
|
||||
std::string S;
|
||||
llvm::raw_string_ostream RSS(S);
|
||||
std::string Err;
|
||||
if (!llvm::WriteSPIRV(M, SS, Err)) {
|
||||
if (!llvm::WriteSPIRV(M, RSS, Err)) {
|
||||
llvm::errs() << "Fails to save LLVM as SPIR-V: " << Err << '\n';
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!DumpSpirv.empty()) {
|
||||
std::ofstream OFS(DumpSpirv, std::ios::binary);
|
||||
OFS << SS.str();
|
||||
OFS << RSS.str();
|
||||
OFS.close();
|
||||
}
|
||||
|
||||
RSS.flush();
|
||||
std::stringstream SS(S);
|
||||
|
||||
auto &Ctx = M->getContext();
|
||||
delete M;
|
||||
M = nullptr;
|
||||
|
||||
@@ -504,12 +504,12 @@ LLVMToSPIRV(
|
||||
}
|
||||
|
||||
std::string spvImg;
|
||||
std::stringstream ss(spvImg);
|
||||
llvm::raw_string_ostream ss(spvImg);
|
||||
bool success = llvm::WriteSPIRV(llMod, ss, errMsg);
|
||||
|
||||
if (opt->isDumpFlagSet(amd::option::DUMP_SPIRV)) {
|
||||
std::ofstream ofs(opt->getDumpFileName(".spv"), std::ios::binary);
|
||||
ofs << spvImg;
|
||||
ofs << ss.str();
|
||||
ofs.close();
|
||||
}
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする