Allow to load llvm bc.

Change-Id: Ibdffafe48d42072536d8b185e74c77489686f728
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
Mrozek, Michal
2019-09-25 14:25:04 -07:00
committed by sys_ocldev
parent a2e1389ff9
commit 4ee44586b5
2 changed files with 5 additions and 1 deletions

View File

@@ -130,7 +130,8 @@ int OfflineCompiler::buildSourceCode() {
bool inputIsIntermediateRepresentation = inputFileLlvm || inputFileSpirV;
if (false == inputIsIntermediateRepresentation) {
UNRECOVERABLE_IF(fclDeviceCtx == nullptr);
IGC::CodeType::CodeType_t intermediateRepresentation = useLlvmText ? IGC::CodeType::llvmLl : preferredIntermediateRepresentation;
IGC::CodeType::CodeType_t intermediateRepresentation = useLlvmText ? IGC::CodeType::llvmLl
: (useLlvmBc ? IGC::CodeType::llvmBc : preferredIntermediateRepresentation);
// sourceCode.size() returns the number of characters without null terminated char
auto fclSrc = CIF::Builtins::CreateConstBuffer(fclMain.get(), sourceCode.c_str(), sourceCode.size() + 1);
auto fclOptions = CIF::Builtins::CreateConstBuffer(fclMain.get(), options.c_str(), options.size());
@@ -489,6 +490,8 @@ int OfflineCompiler::parseCommandLine(size_t numArgs, const std::vector<std::str
argIndex++;
} else if (stringsAreEqual(argv[argIndex], "-llvm_text")) {
useLlvmText = true;
} else if (stringsAreEqual(argv[argIndex], "-llvm_bc")) {
useLlvmBc = true;
} else if (stringsAreEqual(argv[argIndex], "-llvm_input")) {
inputFileLlvm = true;
} else if (stringsAreEqual(argv[argIndex], "-spirv_input")) {

View File

@@ -89,6 +89,7 @@ class OfflineCompiler {
std::string buildLog;
bool useLlvmText = false;
bool useLlvmBc = false;
bool useCppFile = false;
bool useOptionsSuffix = false;
bool quiet = false;