mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
Forcing llvm as intermediate for Link, CreateLib
Link and CreateLibrary will use llvm IR as intermediate representation always Change-Id: I370e92ee258d997f04f40320ab4a478970ee22bd
This commit is contained in:
committed by
sys_ocldev
parent
ea92874a66
commit
c5becf63f7
@@ -369,15 +369,20 @@ TEST_F(CompilerInterfaceTest, LinkIrLinkFailure) {
|
||||
gEnvironment->igcPopDebugVars();
|
||||
}
|
||||
|
||||
TEST_F(CompilerInterfaceTest, LinkIr) {
|
||||
TEST_F(CompilerInterfaceTest, WhenLinkIsCalledThenLlvmBcIsUsedAsIntermediateRepresentation) {
|
||||
// link only from .ll to gen ISA
|
||||
MockCompilerDebugVars igcDebugVars;
|
||||
igcDebugVars.fileName = clFiles + "copybuffer.ll";
|
||||
gEnvironment->igcPushDebugVars(igcDebugVars);
|
||||
retVal = pCompilerInterface->link(*pProgram, inputArgs);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
gEnvironment->igcPopDebugVars();
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_EQ(2U, pCompilerInterface->requestedTranslationCtxs.size());
|
||||
|
||||
MockCompilerInterface::TranslationOpT firstTranslation = {IGC::CodeType::elf, IGC::CodeType::llvmBc},
|
||||
secondTranslation = {IGC::CodeType::llvmBc, IGC::CodeType::oclGenBin};
|
||||
EXPECT_EQ(firstTranslation, pCompilerInterface->requestedTranslationCtxs[0]);
|
||||
EXPECT_EQ(secondTranslation, pCompilerInterface->requestedTranslationCtxs[1]);
|
||||
}
|
||||
|
||||
TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenLinkFailsGracefully) {
|
||||
@@ -429,15 +434,17 @@ TEST_F(CompilerInterfaceTest, CreateLibFailure) {
|
||||
gEnvironment->igcPopDebugVars();
|
||||
}
|
||||
|
||||
TEST_F(CompilerInterfaceTest, CreateLib) {
|
||||
TEST_F(CompilerInterfaceTest, WhenCreateLibraryIsCalledThenLlvmBcIsUsedAsIntermediateRepresentation) {
|
||||
// create library from .ll to IR
|
||||
MockCompilerDebugVars igcDebugVars;
|
||||
igcDebugVars.fileName = clFiles + "copybuffer.ll";
|
||||
gEnvironment->igcPushDebugVars(igcDebugVars);
|
||||
retVal = pCompilerInterface->createLibrary(*pProgram, inputArgs);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
gEnvironment->igcPopDebugVars();
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_EQ(1U, pCompilerInterface->requestedTranslationCtxs.size());
|
||||
|
||||
EXPECT_EQ(IGC::CodeType::llvmBc, pCompilerInterface->requestedTranslationCtxs[0].second);
|
||||
}
|
||||
|
||||
TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenCreateLibraryFailsGracefully) {
|
||||
|
||||
Reference in New Issue
Block a user