You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using OrcJIT in llvm 8.0.0 fails very quickly in an assert failure in MaterializationResponsibility::resolve, which seems to be internal to OrcJIT and out of the control of the user. Just running Kaleidoscope Ch2 as included in the source code distribution causes
assert(I != SymbolFlags.end() &&
"Resolving symbol outside this responsibility set");
in lines 399 and 400 of ExecutionEngine/Orc/Core.cpp to fail. In particular, this seems to reliably happen after entering the second line code, say "5+2" and "5+2".
Originally, I just tried to compile a function that returns an integer constant and is marked as having external linkage, which failed in the same function at lines 407 and 408:
assert(I->second == KV.second.getFlags() &&
"Resolving symbol with incorrect flags");
As far as I can tell from the data, "I" has a Flags field whose value is "Exported | Callable (48 '0')", and "KV" has a Flags field whose value is just "Callable (32 '0')". After setting up a JIT much like in Kaleidoscope, the following is all that this code does to produce that error:
auto theModule = llvm::make_uniquellvm::Module("module", LLVMCONTEXT);
theModule->setDataLayout(NomJIT::Instance()->getDataLayout());
MyJIT::Instance()->addModule(std::move(theModule));
auto MainSymbol = ExitOnErr(MyJIT::Instance()->lookup("testmethod")); //FAILS HERE
int (mainmeth)() = (int ()())(intptr_t)MainSymbol.getAddress();
std::cout<<mainmeth();
I'm running Windows 10 and compiled llvm (from the 8.0.0 source tar available on llvm.org) and the other projects with Visual Studio 2017, and the same problems happen on two different machines with the same setup.
The text was updated successfully, but these errors were encountered:
Extended Description
Using OrcJIT in llvm 8.0.0 fails very quickly in an assert failure in MaterializationResponsibility::resolve, which seems to be internal to OrcJIT and out of the control of the user. Just running Kaleidoscope Ch2 as included in the source code distribution causes
in lines 399 and 400 of ExecutionEngine/Orc/Core.cpp to fail. In particular, this seems to reliably happen after entering the second line code, say "5+2" and "5+2".
Originally, I just tried to compile a function that returns an integer constant and is marked as having external linkage, which failed in the same function at lines 407 and 408:
As far as I can tell from the data, "I" has a Flags field whose value is "Exported | Callable (48 '0')", and "KV" has a Flags field whose value is just "Callable (32 '0')". After setting up a JIT much like in Kaleidoscope, the following is all that this code does to produce that error:
auto theModule = llvm::make_uniquellvm::Module("module", LLVMCONTEXT);
theModule->setDataLayout(NomJIT::Instance()->getDataLayout());
llvm::Function *fun = llvm::Function::Create(llvm::FunctionType::get(INTTYPE, false), llvm::Function::ExternalLinkage, "testmethod", theModule.get());
BasicBlock *startBlock = BasicBlock::Create(LLVMCONTEXT, "testmethod$start", fun);
IRBuilder<> builder(LLVMCONTEXT);
builder.SetInsertPoint(startBlock);
builder.CreateRet(llvm::ConstantInt::get(INTTYPE, 5, true));
if (verifyFunction(*fun))
{
throw "Failed verification";
}
MyJIT::Instance()->addModule(std::move(theModule));
auto MainSymbol = ExitOnErr(MyJIT::Instance()->lookup("testmethod")); //FAILS HERE
int (mainmeth)() = (int ()())(intptr_t)MainSymbol.getAddress();
std::cout<<mainmeth();
I'm running Windows 10 and compiled llvm (from the 8.0.0 source tar available on llvm.org) and the other projects with Visual Studio 2017, and the same problems happen on two different machines with the same setup.
The text was updated successfully, but these errors were encountered: