search for: llvm_context

Displaying 9 results from an estimated 9 matches for "llvm_context".

2013 Apr 24
1
[LLVMdev] JIT pass runtime struct on to subroutines
...lable // create the function for the predicate. This should take one parameter: the machine-struct that will be provided at runtime when the function is called llvm::Function *llvm_function = llvm::cast<llvm::Function>( llvm_module->getOrInsertFunction(*name, llvm::Type::getVoidTy(&llvm_context), llvm::PointerType::getUnqual(llvm::StructType::create(&llvm_context)), (llvm::Type *)0)); // prepare for the construction of this function llvm::BasicBlock *llvm_basic_block = BasicBlock::Create(&llvm_context, "EntryBlock", llvm_function); llvm::IRBuilder<> llvm_builder(ll...
2012 Jul 07
2
[LLVMdev] Crash using the JIT on x86 but work on x64
...uot; #include "llvm/Support/Signals.h" #include "llvm/Support/TargetSelect.h" //#include <cerrno> #include "llvm/DerivedTypes.h" //#include "llvm/Support/DynamicLibrary.h" #include "llvm/Linker.h" //using namespace llvm; llvm::LLVMContext* LLVM_Context; static llvm::ExecutionEngine* LLVM_ExecE = 0; llvm::Module* LLVM_Module; llvm::Type* LLVM_pointerType; bool loadChunk(void* chunk) { llvm::Module* m = (llvm::Module*)chunk; std::string msg; if (llvm::Linker::LinkModules(LLVM_Module, m, llvm::Function::ExternalLinkage, &msg))...
2018 Apr 19
1
How to set Target/Triple of ExecutionEngine
...heers, Lang. On Thu, Apr 19, 2018 at 1:56 AM, edA-qa mort-ora-y via llvm-dev < llvm-dev at lists.llvm.org> wrote: > Taking one step back, I'm not clear I'm even setting the > triple/DataLayout on the module correctly: > > module = new llvm::Module( "test", *llvm_context ); > module->setTargetTriple( platform::target->triple ); > > Is that enough to create an appropriate DataLayout for the module? I > don't see anyway to convert a triple to a DataLayout, so I can't call > `setDataLayout`. > > > On 19/04/18 10:44, edA-qa mo...
2018 Apr 19
0
How to set Target/Triple of ExecutionEngine
Taking one step back, I'm not clear I'm even setting the triple/DataLayout on the module correctly:     module = new llvm::Module( "test", *llvm_context );     module->setTargetTriple( platform::target->triple ); Is that enough to create an appropriate DataLayout for the module?  I don't see anyway to convert a triple to a DataLayout, so I can't call `setDataLayout`. On 19/04/18 10:44, edA-qa mort-ora-y via llvm-dev wrote: > I d...
2018 Apr 19
2
How to set Target/Triple of ExecutionEngine
I don't know if I'm setting the triple of my execution engine correctly.  This is leading to an issue where a struct `{i8,i64}` is not getting the same layout as the ABI expects. I setup my engine/module like this:      llvm::SmallVector<std::string,2> mattrs;      llvm::EngineBuilder builder{ unique_ptr<llvm::Module>(module) };      llvm::ExecutionEngine * ee = builder.    
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
2018 Apr 19
0
A struct {i8, i64} has size == 12, clang says size 16
What exactly is your alignment settings in your LLVM struct? Something like this would tell you the alignment of "something". const llvm::DataLayout dl(theModule); size_t size = dl.getPrefTypeAlignment(something); IIn "my" compiler, I don't do anything special to align structs, so it's plausibly your specific data-layout that says that i64 only needs aligning to
2018 Apr 18
2
A struct {i8, i64} has size == 12, clang says size 16
I think I see a potential issue. My ExecutionEngine setup may not be using the same target as my object code emitting, and in this test case I'm running in the ExecutionEngine.  I'll go over this code to ensure I'm creating the same triple and see if that helps -- I'm assuming it will, since I can't imagine the exact same triple with clang would produce a different layout. On