search for: selecttarget

Displaying 20 results from an estimated 39 matches for "selecttarget".

2012 May 09
2
[LLVMdev] Null pointer dereference
Hi all, Writing my own LLVM client I've noticed a potential null pointer dereference in EngineBuilder::selectTarget. The class has an optional pointer to the ErrorStr, which can be initialzied through setErrorStr() method. Although, it's strictly optional, selectTarget doesn't verify its value before assignment. Please find patch for branch release_31, revision 155051 attached. - Yury -------------- n...
2018 Apr 19
1
How to set Target/Triple of ExecutionEngine
Hi edaqa, You might need to set your TargetOptions before calling selectTarget. E.g. builder.setTargetOptions(Opts).selectTarget(...); Or you could just let EngineBuilder call selectTarget for you (which is what the no-argument version of EngineBuilder::create does): llvm::ExecutionEngine * ee = builder. setErrorStr( &errStr ). setEngineKind( llvm::Engi...
2018 Apr 19
2
How to set Target/Triple of ExecutionEngine
...allVector<std::string,2> mattrs;      llvm::EngineBuilder builder{ unique_ptr<llvm::Module>(module) };      llvm::ExecutionEngine * ee = builder.         setErrorStr( &errStr ).         setEngineKind( llvm::EngineKind::JIT ).         setTargetOptions( topts ).         create(builder.selectTarget( llvm::Triple(llvm::Triple::normalize(platform::target->triple)), "", "", mattrs ));     module->setDataLayout( ee->getDataLayout() ); Where `module` is my `llvm::Module` with the generated IR code. I'm using the triple `x86_64-pc-linux-gnu`, the same as clang on...
2018 Apr 19
0
How to set Target/Triple of ExecutionEngine
...mattrs; >      llvm::EngineBuilder builder{ unique_ptr<llvm::Module>(module) }; >      llvm::ExecutionEngine * ee = builder. >         setErrorStr( &errStr ). >         setEngineKind( llvm::EngineKind::JIT ). >         setTargetOptions( topts ). >         create(builder.selectTarget( > llvm::Triple(llvm::Triple::normalize(platform::target->triple)), "", "", > mattrs )); > >     module->setDataLayout( ee->getDataLayout() ); > > Where `module` is my `llvm::Module` with the generated IR code. > > I'm using the triple `x86_6...
2012 May 09
0
[LLVMdev] Null pointer dereference
...an that minor style detail, this looks fine assuming it applies cleanly to trunk. Do you have commit access? Regards, -Jim On May 9, 2012, at 3:40 PM, Yury Mikhaylov wrote: > Hi all, > > Writing my own LLVM client I've noticed a potential null pointer dereference in EngineBuilder::selectTarget. > > The class has an optional pointer to the ErrorStr, which can be initialzied through setErrorStr() method. Although, it's strictly optional, selectTarget doesn't verify its value before assignment. > > Please find patch for branch release_31, revision 155051 attached. >...
2012 May 09
1
[LLVMdev] Null pointer dereference
...applies cleanly to trunk. > > Do you have commit access? > > Regards, > -Jim > > On May 9, 2012, at 3:40 PM, Yury Mikhaylov wrote: > > > Hi all, > > > > Writing my own LLVM client I've noticed a potential null pointer > dereference in EngineBuilder::selectTarget. > > > > The class has an optional pointer to the ErrorStr, which can be > initialzied through setErrorStr() method. Although, it's strictly optional, > selectTarget doesn't verify its value before assignment. > > > > Please find patch for branch release_31, re...
2012 Dec 21
2
[LLVMdev] How to print machine code of JIT IR
Hi, I am using LLVM 3.1, and wants to print the machine code of JIT IR I try the following method EngineBuilder builder(&ctx.getModule()); builder.setEngineKind(EngineKind::JIT); * TargetMachine * tm = builder.selectTarget(); tm->Options.PrintMachineCode = true;* engine = builder.create(); and somewhere in my code, I use runJITonFunction(); Another question is that I am not sure when JIT would dump machine code. Does anyone know how to do that ? Chia Lun Liu -- View this message in context: http:/...
2012 Dec 21
0
[LLVMdev] How to print machine code of JIT IR
...u, On 12/21/12 7:47 AM, ChiaLun wrote: > I am using LLVM 3.1, and wants to print the machine code of JIT IR > > I try the following method > > EngineBuilder builder(&ctx.getModule()); > builder.setEngineKind(EngineKind::JIT); > * > TargetMachine * tm = builder.selectTarget(); > tm->Options.PrintMachineCode = true;* > engine = builder.create(); Try builder.create(tm). selectTarget() returns a new object, so setting options on that has no effect on the ExecutionEngine which is built by the create() call. In fact, EngineBuilder.create() just creates...
2013 Jul 18
2
[LLVMdev] LLVM 3.3 JIT code speed
...ue; targetOptions.LessPreciseFPMADOption = true; targetOptions.UnsafeFPMath = true; targetOptions.NoInfsFPMath = true; targetOptions.NoNaNsFPMath = true; targetOptions.GuaranteedTailCallOpt = true; builder.setTargetOptions(targetOptions); TargetMachine* tm = builder.selectTarget(); fJIT = builder.create(tm); if (!fJIT) { return false; } …. Any idea? Thanks. Stéphane Letz
2014 Jan 07
2
[LLVMdev] Generating PIC object files from the LLVM API
I'm trying to add static code generation capabilities to my MCJIT compiler on LLVM 3.4. To that extent I have: targetMachine = engineBuilder.selectTarget(); // ... targetMachine->addPassesToEmitFile(<...>); At first glance this appears to work, but when linking the object file I get the warning: ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in <...>. To...
2014 Aug 18
2
[LLVMdev] Disabling some JIT optimization?
I am currently trying to use LLVM (version 3.2) to generate code for a cluster where each node in the cluster will be running a 64-bit X86 chip, but *not* necessarily the same version of the X86 chip throughout the cluster. I am specifying that I want Position-Independent Code produced because the generated machine code may get moved (before it is executed) to a different logical address that
2016 Sep 14
4
setDataLayout segfault
...neBuilder.setOptLevel(llvm::CodeGenOpt::Aggressive); engineBuilder.setErrorStr(&mcjit_error); llvm::TargetOptions targetOptions; targetOptions.AllowFPOpFusion = llvm::FPOpFusion::Fast; engineBuilder.setTargetOptions( targetOptions ); TargetMachine *targetMachine = engineBuilder.selectTarget(); assert(targetMachine && "failed to create target machine"); std::cout << targetMachine->createDataLayout().getStringRepresentation() << "\n"; Mod.get()->setDataLayout( targetMachine->createDataLayout().getStringRepresentation() ); //...
2012 Sep 12
2
[LLVMdev] [llvm-commits] [llvm] r160610 - /llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp
...================================================ > --- llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp (original) > +++ llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp Sat Jul 21 22:04:57 > +++ 2012 > @@ -26,7 +26,7 @@ > using namespace llvm; > > TargetMachine *EngineBuilder::selectTarget() { > - Triple TT(M->getTargetTriple()); > + Triple TT(LLVM_HOSTTRIPLE); > return selectTarget(TT, MArch, MCPU, MAttrs); }
2013 Jul 18
0
[LLVMdev] LLVM 3.3 JIT code speed
...PMADOption = true; > targetOptions.UnsafeFPMath = true; > targetOptions.NoInfsFPMath = true; > targetOptions.NoNaNsFPMath = true; > targetOptions.GuaranteedTailCallOpt = true; > > builder.setTargetOptions(targetOptions); > > TargetMachine* tm = builder.selectTarget(); > > fJIT = builder.create(tm); > if (!fJIT) { > return false; > } > …. > > Any idea? It's hard to say much without seeing the specific IR and the code generated from that IR. -Eli
2011 Jun 21
1
[LLVMdev] Instantiating a JIT on win64
...iate a JIT. I can get into the JIT::createJIT function, but i then fail to find an appropriate JIT for my architecture (which is actually X86_64-win64, via visual c++ compilation. I also had to fiddle around to get LLVM 2.9 to compile under the custom build system I'm working with). The JIT::selectTarget call infers a triple of "x86_64-pc-win32", which then fails to find a target machine. Interestingly, the TargetRegistry appears to be empty, which doesn't seem right (maybe i haven't linked in a library that populates this?). I also tried specifying MCPU as "X86_64"/&qu...
2016 Jun 11
3
SegFault creating a ExecutionEngine
My code to create an ExecutionEngine is segfaulting: std::string errStr; llvm::ExecutionEngine * ee = llvm::EngineBuilder( unique_ptr<llvm::Module>(module) ) .setErrorStr( &errStr ) //line 1618 .setEngineKind( llvm::EngineKind::JIT ) Where module is a `llvm::Module*`. This is code I'm migrating from 3.3 to 3.8. Since the deletion error is happening during
2016 Sep 14
2
setDataLayout segfault
...;> engineBuilder.setErrorStr(&mcjit_error); >> >> llvm::TargetOptions targetOptions; >> targetOptions.AllowFPOpFusion = llvm::FPOpFusion::Fast; >> engineBuilder.setTargetOptions( targetOptions ); >> >> TargetMachine *targetMachine = engineBuilder.selectTarget(); >> >> assert(targetMachine && "failed to create target machine"); >> >> std::cout << >> targetMachine->createDataLayout().getStringRepresentation() << "\n"; >> >> Mod.get()->setDataLayout( >> ta...
2013 Jul 18
2
[LLVMdev] LLVM 3.3 JIT code speed
...targetOptions.UnsafeFPMath = true; >> targetOptions.NoInfsFPMath = true; >> targetOptions.NoNaNsFPMath = true; >> targetOptions.GuaranteedTailCallOpt = true; >> >> builder.setTargetOptions(targetOptions); >> >> TargetMachine* tm = builder.selectTarget(); >> >> fJIT = builder.create(tm); >> if (!fJIT) { >> return false; >> } >> …. >> >> Any idea? > > It's hard to say much without seeing the specific IR and the code > generated from that IR. > > -Eli Our lan...
2012 Sep 12
0
[LLVMdev] [llvm-commits] [llvm] r160610 - /llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp
...======================== > ======== > --- llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp (original) > +++ llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp Sat Jul 21 > +++ 22:04:57 > +++ 2012 > @@ -26,7 +26,7 @@ > using namespace llvm; > > TargetMachine *EngineBuilder::selectTarget() { > - Triple TT(M->getTargetTriple()); > + Triple TT(LLVM_HOSTTRIPLE); > return selectTarget(TT, MArch, MCPU, MAttrs); }
2016 May 17
3
External function resolution: MCJIT vs ORC JIT
...sqr (float x) { return x*x; } } void simple () { llvm::InitializeAllTargets(); llvm::InitializeAllTargetMCs(); llvm::InitializeAllAsmPrinters(); llvm::InitializeAllAsmParsers(); llvm::LLVMContext Context; std::unique_ptr<llvm::TargetMachine> TM (llvm::EngineBuilder().selectTarget()); std::unique_ptr<llvm::DataLayout> DL; DL.reset (new llvm::DataLayout (TM->createDataLayout())); std::unique_ptr<llvm::ExecutionEngine> EE; typedef llvm::orc::ObjectLinkingLayer<> ObjLayerT; typedef llvm::orc::IRCompileLayer<ObjLayerT> CompileLayerT...