search for: findfunctionnam

Displaying 17 results from an estimated 17 matches for "findfunctionnam".

Did you mean: findfunctionnamed
2013 Oct 22
1
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Andy, I added the runStaticConstructorsDestructors and FindFunctionNamed functions. This also required making them virtual in EE.h. I'm not sure about FindFunctionNamed: In addition to searching finalized modules, should it search Added and Loaded modules? If it finds a Function in these, should it compile and finalize it before returning the Function* ? I modif...
2013 Oct 22
0
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Yaron, Overall this looks great. There are a couple of remaining holes. Specifically, MCJIT inherits implementations of the FindFunctionNamed and runStaticConstructorsDestructors methods from ExecutionEngine which use the old Modules vector, so you'll need to override these in MCJIT. (The implementations are fairly trivial.) Beyond that I just have a couple of questions. First, OwningModuleContainer::hasModuleBeenAdded seems wro...
2013 Oct 22
2
[LLVMdev] SmallPtrSet patch for MCJIT
Hi Andy, Here is the patch. it incorporates: 1) your latest patch to SVN. 2) mcjit-module-state-optimization.patch. 3) the PtrSet changes. Other than the OwnedModules implementation there were other differences between 1) and 2), especially in the Finalize* functions, so please review that I got the right code. I got bitten by subtle bugs arising from MCJIT inheriting from EE: First, MCJIT
2007 Aug 08
1
[LLVMdev] In-memory compilation/execution
...l the functions will be called. Is there a way to compile all the functions immediately (I guess this would be slightly more efficient)? 3. The compiled code needs to call functions in the host application. Dynamic linking is not an option (Windows). I'm now using the ExecutionEngine's FindFunctionNamed and addGlobalMapping method to bind declared external functions in the compiled code to host functions. Is this the best way to do it? Thanks! Alain
2010 Sep 28
2
[LLVMdev] ExecutionEngine::create returns 0
...I tried using llvm-config with flags '--libs core engine jit native'. But ExecutionEngine returns NULL. I even tried including the JIT.h. No luck there too. Here is my code listing: llvm::ExecutionEngine* ee = llvm::ExecutionEngine::create(mModule); llvm::Function* func = ee->FindFunctionNamed("main"); typedef void (*PFN)(); PFN pfn = reinterpret_cast<PFN> (ee->getPointerToFunction(func)); pfn(); delete ee; thanks, subramanyam -- View this message in context: http://old.nabble.com/ExecutionEngine%3A%3Acreate-returns-0-tp17710149p29825737.html Sent from the LLV...
2010 Jan 29
2
[LLVMdev] Redefining function
...Module *file2(LoadFile("file2.bc",Context)); Module *file3(LoadFile("file3.bc",Context)); Linker::LinkModules(file1, file2, NULL); EngineBuilder builder(file1); ExecutionEngine *EE = builder.create(); EE->runStaticConstructorsDestructors(false); func = EE->FindFunctionNamed("do_print"); EE->runFunction(func, std::vector<GenericValue>()); //swap the definition of the function "print" from the one in File2.c to File3.c swap (file1, file2, file3); EE->runFunction(func, std::vector<GenericValue>()); EE->runStaticCons...
2013 Apr 24
1
[LLVMdev] JIT pass runtime struct on to subroutines
...the instruction's parameters foreach (instruction in predicate) { // Fetch the instruction from the already initialised execution engine. I can do this because I compiled all instruction-functions to an LLVM Module and loaded it. llvm::Function *machine_instr = llvm_execution_engine->FindFunctionNamed(instruction_function_name); // Prepare for setting the parameters of a call instruction llvm::Argument *llvm_arg = machine_instr->arg_begin(); // Add a pointer to the machine-struct as a first parameter to every instruction-function call. // This should be the same pointer tha...
2012 Dec 27
1
[LLVMdev] Throwing an exception from JITed code, and catching in C++
...if (!m) { printf("could not load module\n"); return 1; } ExecutionEngine* ee = ExecutionEngine::create(m); if (!ee) { printf("could not create execution engine\n"); return 1; } Function* throwsIntFunction = ee->FindFunctionNamed("_Z8throwIntv"); if (!throwsIntFunction) { printf("could not find function\n"); return 1; } typedef void (*throwsIntType)(); throwsIntType throwsInt = reinterpret_cast(ee->getPointerToFunction(throwsIntFunction)); if (!throwsInt)...
2019 Jan 26
2
How to pass arbitrary arguments to runFunctionAsMain?
...at MyInterpreter extends Interpreter StringRef filename = argv[1]; std::unique_ptr<Module> m(parseIRFile(filename, error, context)); MyInterpreter * v = new MyInterpreter(std::move(m)); v->finalizeObject(); errs() << "Done\n"; Function *main = v->FindFunctionNamed("main"); errs() << " Function " << main->getName().str() << "\n"; std::vector<std::string> parameters; parameters.insert(parameters.begin(), "argv"); const char* const* envp; for (int i=1; i<argc;i++)...
2008 Jun 10
0
[LLVMdev] ExecutionEngine::create returns 0
On Tue, 10 Jun 2008 07:07:35 +0530, Mahadevan R wrote: >> Now to compare it in detail with the much smaller program I've got and >> maybe I'll figure out what's wrong with my call to >> ExecutionEngine::create. > > That call is perfectly valid, actually. It works for me when linked > with: > > g++ -o b b.o `llvm-config --ldflags` `llvm-config --libs
2012 Dec 13
0
[LLVMdev] Memory leaks after llvm_shutdown
...; "\n"; return 3; } } Module *m = llvm_linker.releaseModule(); string err; ExecutionEngine *ee = EngineBuilder(m).setEngineKind(EngineKind::JIT).setErrorStr(&err).create(); ee->DisableGVCompilation(false); ee->DisableLazyCompilation(true); Function* func = ee->FindFunctionNamed(argv[1]); if(!func){ cout<<"cannot find entry point\n"; return -1; } typedef void (*PFN)(); PFN pfn = reinterpret_cast<PFN>(ee->getPointerToFunction(func)); pfn(); ee->freeMachineCodeForFunction(func); delete ee; return 0; }
2008 Jun 10
2
[LLVMdev] ExecutionEngine::create returns 0
> Now to compare it in detail with the much smaller program I've got and > maybe I'll figure out what's wrong with my call to > ExecutionEngine::create. That call is perfectly valid, actually. It works for me when linked with: g++ -o b b.o `llvm-config --ldflags` `llvm-config --libs engine jit` Cheers, -Mahadevan.
2010 Jan 30
0
[LLVMdev] Redefining function
Hi Conrado, > I couldn't find the solution to my problem (if it has one) in the > mailing list or the source code. The problem is: how can I redefine a > function that's been called already by some other function? why do you want to do this? > Suppose I have 3 files, all compiled to bytecode through llvm-gcc (I > think it could be clang instead). > > File1.c:
2009 Mar 09
0
[LLVMdev] Cross-Module Function Calls
...etBitcodeModuleProvider(bar_buffer,&err); llvm::ExecutionEngine *engine; engine = llvm::ExecutionEngine::create( foo_provider ); engine->addModuleProvider( bar_provider ); std::vector<std::string> args; args.push_back( "foo.ll" ); llvm::Function *fn_main = engine->FindFunctionNamed( "main" ); int rv = engine->runFunctionAsMain( fn_main, args, environ ); return rv; } //// #### Makefile AS=/home/terrence/programming/OSS-rcs/llvm/Debug/bin/llvm-as LD=/home/terrence/programming/OSS-rcs/llvm/Debug/bin/llvm-ld CC=g++ LLVM_CONFIG=/home/terrence/programming/OSS-rcs/...
2010 Jan 30
2
[LLVMdev] Redefining function
...ribute. You then link all three files > together, and the weak print in File2 will be magically replaced with the > non-weak print in File3. Never heard of it before. After a quick reading, it sounds OK. Keeping the rest of the file, changed the attribute and this section: func = EE->FindFunctionNamed ("do_print"); EE->runFunction(func, std::vector<GenericValue> ()); Linker::LinkModules(main_file, print2, &ErrorMessage); EE->runFunction(func, std::vector<GenericValue> ()); And now I get this error before the second runFunction: While deleting: void ()* %...
2018 May 05
0
Slow IR compilation/JIT, profiling points to LLVM?
Hi, Could you share how you compile IR and which version of JIT you use (Orc, MCJIT)? Could it be that you are using interpreter instead of actual JIT? Cheers, Alex. > On 5. May 2018, at 08:04, edA-qa mort-ora-y via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > I'm having issues of my compiler, and JIT execution, of LLVM IR being > rather slow. It's accounting for
2018 May 05
4
Slow IR compilation/JIT, profiling points to LLVM?
I'm having issues of my compiler, and JIT execution, of LLVM IR being rather slow. It's accounting for the vast majority of my full compilation time.  I'm trying to figure out why this is happening, since it's becoming an impediment.  (Note: by slow I mean about 3s of time for only about 2K of my front-end code, 65K lines of LLVM-IR) Using valgrind I see some functions which seem