search for: themodule

Displaying 20 results from an estimated 103 matches for "themodule".

2014 Aug 25
3
[LLVMdev] Module->getDataLayout returns std::string instead of DataLayout
hey, so I'm writing in cpp. the documentation says that TheModule -> getDataLayout should return const DataLayout, but instead it is returning std::string. I require it to return DataLayout, as I generalize my function pass manager to accept the DataLayout constant as an argument, it being the only thing in common amongst both the ExecutionEngine and the Mod...
2007 Sep 20
0
[LLVMdev] Valgrind Help Needed
...> testcase.mi:12: internal compiler error: Bus error > Please submit a full bug report, > with preprocessed source if appropriate. > See <URL:http://llvm.org/bugs> for instructions. In llvm-backend.cpp : 1086 if (GV->getName() != Name) { 1087 Function *F = TheModule->getFunction(Name); 1088 assert(F && F->isDeclaration() && "A function turned into a global?"); 1089 1090 // Replace any uses of "F" with uses of GV. 1091 Value *FInNewType = ConstantExpr::getBitCast(GV, F- >getType());...
2007 Sep 19
3
[LLVMdev] Valgrind Help Needed
Hi all, This program: @protocol CPTransferThreadObserving; @interface CPMode {} @end @implementation CPMode -(void) copyInBackgroundAndNotifyUsingPorts { id client; [client setProtocolForProxy: @protocol(CPTransferThreadObserving)]; } @end produces this internal compiler error: $ llvm-gcc -x objective-c -arch ppc64 -std=c99 -c testcase.mi testcase.mi:12: internal compiler
2010 Jan 22
3
[LLVMdev] Kaleidoscope-tutorial: Fails to create the JIT
...hich result's in a null-pointer for "TheExecutionEngine"; which explains the bus-errror .. The main code is || ... //GAM some setting of vars || fprintf(stderr, "ready> "); || getNextToken(); || || // Make the module, which holds all the code. || TheModule = new Module("my cool jit", getGlobalContext()); || //GAM: check TheModule: it's a valid pointer || || // create the JIT. || TheExecutionEngine = EngineBuilder(TheModule).create(); || //GAM: check TheExecutionEngine: IT IS A NULL POINTER [My addition are annotated by ...
2010 Mar 18
2
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
Hello I have the following scenario, and I am not sure why the performance is so bad (take 30 minutes to complete with very simple generated functions): 1. Create module 2. Do something like EE = EngineBuilder(theModule).setEngineKind(EngineKind::JIT).create(); 3. Create a function in the module: theModule->getOrInsertFunction(..) 4. Execute 1000 times the function using EE->runFunction(function, args) with different args in each round. My question - Does section 4 above makes the EE recompile the function...
2007 Sep 20
2
[LLVMdev] Valgrind Help Needed
...iler error: Bus error >> Please submit a full bug report, >> with preprocessed source if appropriate. >> See <URL:http://llvm.org/bugs> for instructions. > > In llvm-backend.cpp : > > 1086 if (GV->getName() != Name) { > 1087 Function *F = TheModule->getFunction(Name); > 1088 assert(F && F->isDeclaration() && "A function turned > into a global?"); > 1089 > 1090 // Replace any uses of "F" with uses of GV. > 1091 Value *FInNewType = ConstantExpr::getBitCast...
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
...-- llvm-convert.cpp (revision 111673) +++ llvm-convert.cpp (working copy) @@ -795,14 +795,18 @@ void TreeToLLVM::EmitMemCpy(Value *DestP unsigned Align) { const Type *SBP = PointerType::get(Type::SByteTy); static Function *MemCpy = 0; - if (!MemCpy) - MemCpy = TheModule->getOrInsertFunction("llvm.memcpy", Type::VoidTy, SBP, - SBP, Type::UIntTy, Type::UIntTy, + const Type *IntPtr = TD.getIntPtrType(); + if (!MemCpy) { + const char *Name = IntPtr == Type::UIntTy ? + "llvm.memcpy...
2018 Aug 16
2
Convert Function Pointer Call to Function Call at the IR Level
...g definition: ... define internal i32 @demux_lavf_control(%struct.demuxer.2657* nocapture readonly, i32, i8* nocapture) #0 !dbg !963916 { ... I wrote a function pass and found the mentioned function pointer call (here, stored in "CallInstr") and set the call target as follows: ... Module *theModule = F.getParent(); Function *targetFunc = theModule->getFunction("demux_lavf_control"); CalIInstr->setCalledFunction(targetFunc); ... "F" is the function containing the call. But it leads to the following error: ... Call parameter type does not match function signature! %str...
2010 Jan 22
0
[LLVMdev] Kaleidoscope-tutorial: Fails to create the JIT
...the bus-errror .. > > The main code is >  || ...                                                                //GAM some setting of vars >  ||  fprintf(stderr, "ready> "); >  ||  getNextToken(); >  || >  || // Make the module, which holds all the code. >  ||  TheModule = new Module("my cool jit", getGlobalContext()); >  ||  //GAM: check TheModule: it's a valid pointer >  || >  ||  // create the JIT. >  || TheExecutionEngine = EngineBuilder(TheModule).create(); Try changing the above line to: std::string str; TheExecutionEngine = Eng...
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...e static PrototypeAST *ParseExtern() { getNextToken(); // eat extern. return ParsePrototype(); } //===----------------------------------------------------------------------===// // Code Generation //===----------------------------------------------------------------------===// static Module *TheModule; static IRBuilder<> Builder(getGlobalContext()); static std::map<std::string, Value*> NamedValues; static FunctionPassManager *TheFPM; Value *ErrorV(const char *Str) { Error(Str); return 0; } Value *NumberExprAST::Codegen() { return ConstantFP::get(getGlobalContext(), APFloat(Val));...
2007 Sep 20
1
[LLVMdev] Valgrind Help Needed
On Sep 19, 2007, at 5:41 PM, Devang Patel wrote: > On Sep 19, 2007, at 4:48 PM, Bill Wendling wrote: > > In llvm-backend.cpp : > > 1086 if (GV->getName() != Name) { > 1087 Function *F = TheModule->getFunction(Name); > 1088 assert(F && F->isDeclaration() && "A function turned > into a global?"); > 1089 > 1090 // Replace any uses of "F" with uses of GV. > 1091 Value *FInNewType = ConstantExpr::getBitCast...
2013 Aug 28
1
[LLVMdev] Casting and intrinsic function calls
...c operations on Value pointers. I have read the online documentation and relevant portions of the source code and wrote the following code to do a Float to Double cast and then a log operation- Value *castFP(Value *i, Type *ty) const { return b->CreateFPCast(i, ty, n); } \\b is an IRBuilder and TheModule is an llvm::Module Value *intrinsic(Value *i, Intrinsic::ID id) const { vector<Type*> args; args.push_back(i->getType()); Function *intrinsic = Intrinsic::getDeclaration(TheModule, id, args); return b->CreateCall(intrinsic, i, n); } Value *log(Value *i) const { i = castFP(i, Type::getD...
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...tToken(); // eat extern. > return ParsePrototype(); > } > > > //===----------------------------------------------------------------------===// > // Code Generation > > //===----------------------------------------------------------------------===// > > static Module *TheModule; > static IRBuilder<> Builder(getGlobalContext()); > static std::map<std::string, Value*> NamedValues; > static FunctionPassManager *TheFPM; > > Value *ErrorV(const char *Str) { Error(Str); return 0; } > > Value *NumberExprAST::Codegen() { > return ConstantFP::g...
2007 Sep 20
0
[LLVMdev] Valgrind Help Needed
...t; Please submit a full bug report, >>> with preprocessed source if appropriate. >>> See <URL:http://llvm.org/bugs> for instructions. >> >> In llvm-backend.cpp : >> >> 1086 if (GV->getName() != Name) { >> 1087 Function *F = TheModule->getFunction(Name); >> 1088 assert(F && F->isDeclaration() && "A function >> turned into a global?"); >> 1089 >> 1090 // Replace any uses of "F" with uses of GV. >> 1091 Value *FInNewType = Cons...
2010 Mar 18
0
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
...1 AM, Gabi <bugspynet at gmail.com> wrote: > Hello > I have the following scenario, and I am not sure why the performance > is so bad (take 30 minutes to complete with very simple generated > functions): > > 1. Create module > 2. Do something like EE = > EngineBuilder(theModule).setEngineKind(EngineKind::JIT).create(); > 3. Create a function in the module: theModule->getOrInsertFunction(..) > 4. Execute 1000 times the function using EE->runFunction(function, > args) with different args in each round. > > My question - Does section 4 above makes the E...
2019 Aug 07
2
Trouble with ORCv2 Tutorial
...the front end to deal with some slight API changes introduced in the JIT tutorial where some functions return Expected. For example, the specific place that this is failing: FnIR->print(errs()); fprintf(stderr, "\n"); - TheJIT->addModule(std::move(TheModule)); + auto add_q = TheJIT->addModule(std::move(TheModule)); + assert(add_q && "HandleDefinition: Error adding a module."); InitializeModuleAndPassManager(); I've looked at a previous thread discussing moving from ORCv1 to ORCv2 [3] and watched...
2008 Mar 29
1
[LLVMdev] Noob questoin on ExecutionEngine::create
Hello! I'm using llvm v2.1 on FC8. I'm having some trouble with the tutorial on adding JIT. I'm just trying to compile the following code: using namespace llvm; static ExecutionEngine *TheExecutionEngine; static Module *TheModule; int main(){ TheModule = new Module("my cool jit"); TheExecutionEngine = ExecutionEngine::create(TheModule); } I'm using the following command-line for compiling: -- g++ -g test.cpp `llvm-config --cppflags --ldflags --libs core jit native I get an error that says: The headers I...
2008 Mar 29
0
[LLVMdev] no matching function call to llvm::ExecutionEngine::create(llvm::Module*&)
...m a noob to llvm and I'm running through the tutorial for adding JIT. I"m using llvm 2.1 on FC8. I'm just trying to compile this very simple piece of code based upon the full code listing in the tutorial: using namespace std; static ExecutionEngine *TheExecutionEngine; static Module *TheModule; int main() { TheModule = new Module("my cool jit"); TheExecutionEngine = ExecutionEngine::create(TheModule); } I'm using all the headers mentioned in the full code listing of the 'adding JIT' tutorial. When I compile the above code, I get the following error: error: no mat...
2010 Feb 17
1
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...rn ParsePrototype(); >> } >> >> >> //===----------------------------------------------------------------------===// >> // Code Generation >> >> //===----------------------------------------------------------------------===// >> >> static Module *TheModule; >> static IRBuilder<> Builder(getGlobalContext()); >> static std::map<std::string, Value*> NamedValues; >> static FunctionPassManager *TheFPM; >> >> Value *ErrorV(const char *Str) { Error(Str); return 0; } >> >> Value *NumberExprAST::Codegen()...
2006 Mar 02
4
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
On Thu, 2 Mar 2006, Vladimir Prus wrote: >>> The instructions seem to have one path wrong. It says to get: >> >> I'll put together a tarball today. That will be easier than dealing with >> a patch, and it will include a bunch of bugfixes since the previous email. > Further into process, I get this error: > In file included from