search for: printmachinecode

Displaying 20 results from an estimated 23 matches for "printmachinecode".

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://llvm.1065342.n5.nabble.com/How-to-pri...
2005 May 17
2
[LLVMdev] Register Allocation problem
...ur to correct this error? For the passes in emitting assembly I have this: " PM.add(createLowerGCPass()); PM.add(createLowerInvokePass()); PM.add(createLowerSwitchPass()); PM.add(createUnreachableBlockEliminationPass()); PM.add(create<MYTARGET>ISelSimple(*this)); if(PrintMachineCode) PM.add(createMachineFunctionPrinterPass(&std::cerr)); PM.add(createRegisterAllocator()); if(PrintMachineCode) PM.add(createMachineFunctionPrinterPass(&std::cerr)); PM.add(createPrologEpilogCodeInserter()); PM.add(create<MYTARGET>AsmPrinter(Out, *...
2009 Mar 30
1
[LLVMdev] Print native code emitted by the JIT
Hi everybody, I'm toying with the Kaleidoscope example from the documentation (with llvm 2.5) and I want to print out on stderr, the native code (X86) emitted with the JIT. I have found the "createMachineFunctionPrinterPass" function. But when I add it to the FunctionPassManager ( OurFPM.add(createMachineFunctionPrinterPass(cerr, "")); ). I get an error at runtime :
2012 Oct 03
1
[LLVMdev] Getting dump of native assembly?
I'm using the IRBuilder C++ API to generate LLVM IR code and execute it on-the-fly. I know about Module::dump() to print the IR code, but is there any way to print out the native assembly code (x86 in my case)? - Paul
2012 Dec 21
0
[LLVMdev] How to print machine code of JIT IR
...> 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 passes a newly created TargetMachine: >...
2006 Mar 23
0
[LLVMdev] Re: LLVM JIT questions
...something like this should work when your app starts up: static const char * const Args[] = { "", "-print-machineinstrs", 0 }; cl::ParseCommandLineOptions(2, Args); .. this lets you pass other options to LLVM, which could be useful later. Alternatively, you can just set llvm::PrintMachineCode to 1 (defined in llvm/Target/TargetOptions.h). > * Is there a way to delete a function and the generated code? > (have not really looked enough into the documentation to find an answer > myself for this, sorry if it's an obvious one) > [probably will not not use this anyway]...
2013 Feb 08
1
[LLVMdev] JIT on armhf
> So I'm using "llvm/ExecutionEngine/MCJIT.h" instead of > "llvm/ExecutionEngine/JIT.h", and I've added setUseMCJIT(true) to > EngineBuilder, but what actually happens is: > > LLVM ERROR: Target does not support MC emission! > > Do I need to do anything else? IIRC, this error might be due to not linking against the MCJIT library component. Add the
2010 Jun 25
3
[LLVMdev] Why code doesn't speed up much with optimization level increase?
I run large piece of code in JIT and it runs only marginallty faster with optimization levels 1,2,3. I think differences are within the margin or error. level user time 0 17339ms 1 16913ms 2 16891ms 3 16898ms Level is set with builder->setOptLevel(olev); Compilation time is excluded by taking the only top-level function address before the run
2010 May 28
0
[LLVMdev] Combining Branch Statements - Missing Optimization Pass?
The thread here should help. http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-May/031624.html On May 28, 2010, at 6:35 AMPDT, Curtis Faith wrote: > I have some LLVM IR after the optimization passes defined in createStandardModulePasses with the optimization level set to 3. It contains what appears to me to be an easily optimizable branch statement. > > In particular, note in the code
2008 Mar 30
3
[LLVMdev] Being able to know the jitted code-size before emitting
Hi everyone, vmkit requires to know the size of a jitted method before emitting the method. This allows to allocate the correct size for the method. The attached patch creates this functionality when the flag SizedMemoryCode is on. In order to implement this functionality, i had to virtualize some MachineCodeEmitter functions. Is it OK to commit the patch? Thanks, Nicolas --------------
2008 Apr 01
2
[LLVMdev] Being able to know the jitted code-size before emitting
...de "llvm/CodeGen/SizeEmitter.h" >> #include "llvm/CodeGen/Collector.h" >> #include "llvm/Target/TargetOptions.h" >> #include "llvm/Transforms/Scalar.h" >> @@ -257,7 +258,13 @@ >> >> if (addPreEmitPass(PM, Fast) && PrintMachineCode) >> PM.add(createMachineFunctionPrinterPass(cerr)); >> + >> + if (SizedMemoryCode) { >> + SizeEmitter * SE = new SizeEmitter(&MCE); >> + addSimpleCodeEmitter(PM, Fast, false, *SE); >> + } >> >> + >> addCodeEmitter(PM, Fast, Pri...
2008 Mar 31
0
[LLVMdev] Being able to know the jitted code-size before emitting
...ses.h" > +#include "llvm/CodeGen/SizeEmitter.h" > #include "llvm/CodeGen/Collector.h" > #include "llvm/Target/TargetOptions.h" > #include "llvm/Transforms/Scalar.h" > @@ -257,7 +258,13 @@ > > if (addPreEmitPass(PM, Fast) && PrintMachineCode) > PM.add(createMachineFunctionPrinterPass(cerr)); > + > + if (SizedMemoryCode) { > + SizeEmitter * SE = new SizeEmitter(&MCE); > + addSimpleCodeEmitter(PM, Fast, false, *SE); > + } > > + > addCodeEmitter(PM, Fast, PrintEmittedAsm, MCE); > > PM.a...
2008 Apr 01
0
[LLVMdev] Being able to know the jitted code-size before emitting
...izeEmitter.h" >>> #include "llvm/CodeGen/Collector.h" >>> #include "llvm/Target/TargetOptions.h" >>> #include "llvm/Transforms/Scalar.h" >>> @@ -257,7 +258,13 @@ >>> >>> if (addPreEmitPass(PM, Fast) && PrintMachineCode) >>> PM.add(createMachineFunctionPrinterPass(cerr)); >>> + >>> + if (SizedMemoryCode) { >>> + SizeEmitter * SE = new SizeEmitter(&MCE); >>> + addSimpleCodeEmitter(PM, Fast, false, *SE); >>> + } >>> >>> + >>...
2008 Apr 04
3
[LLVMdev] Being able to know the jitted code-size before emitting
...gt;>> #include "llvm/CodeGen/Collector.h" >>>> #include "llvm/Target/TargetOptions.h" >>>> #include "llvm/Transforms/Scalar.h" >>>> @@ -257,7 +258,13 @@ >>>> >>>> if (addPreEmitPass(PM, Fast) && PrintMachineCode) >>>> PM.add(createMachineFunctionPrinterPass(cerr)); >>>> + >>>> + if (SizedMemoryCode) { >>>> + SizeEmitter * SE = new SizeEmitter(&MCE); >>>> + addSimpleCodeEmitter(PM, Fast, false, *SE); >>>> + } >>>...
2008 Apr 05
2
[LLVMdev] Being able to know the jitted code-size before emitting
.../Collector.h" >>>>>> #include "llvm/Target/TargetOptions.h" >>>>>> #include "llvm/Transforms/Scalar.h" >>>>>> @@ -257,7 +258,13 @@ >>>>>> >>>>>> if (addPreEmitPass(PM, Fast) && PrintMachineCode) >>>>>> PM.add(createMachineFunctionPrinterPass(cerr)); >>>>>> + >>>>>> + if (SizedMemoryCode) { >>>>>> + SizeEmitter * SE = new SizeEmitter(&MCE); >>>>>> + addSimpleCodeEmitter(PM, Fast, false, *...
2008 Apr 05
0
[LLVMdev] Being able to know the jitted code-size before emitting
...gt;>>>>>> #include "llvm/Target/TargetOptions.h" >>>>>>> #include "llvm/Transforms/Scalar.h" >>>>>>> @@ -257,7 +258,13 @@ >>>>>>> >>>>>>> if (addPreEmitPass(PM, Fast) && PrintMachineCode) >>>>>>> PM.add(createMachineFunctionPrinterPass(cerr)); >>>>>>> + >>>>>>> + if (SizedMemoryCode) { >>>>>>> + SizeEmitter * SE = new SizeEmitter(&MCE); >>>>>>> + addSimpleCodeEmitter...
2008 Apr 04
0
[LLVMdev] Being able to know the jitted code-size before emitting
...e "llvm/CodeGen/Collector.h" >>>>> #include "llvm/Target/TargetOptions.h" >>>>> #include "llvm/Transforms/Scalar.h" >>>>> @@ -257,7 +258,13 @@ >>>>> >>>>> if (addPreEmitPass(PM, Fast) && PrintMachineCode) >>>>> PM.add(createMachineFunctionPrinterPass(cerr)); >>>>> + >>>>> + if (SizedMemoryCode) { >>>>> + SizeEmitter * SE = new SizeEmitter(&MCE); >>>>> + addSimpleCodeEmitter(PM, Fast, false, *SE); >>>&gt...
2008 Apr 07
2
[LLVMdev] Being able to know the jitted code-size before emitting
...gt;>> #include "llvm/Target/TargetOptions.h" >>>>>>>> #include "llvm/Transforms/Scalar.h" >>>>>>>> @@ -257,7 +258,13 @@ >>>>>>>> >>>>>>>> if (addPreEmitPass(PM, Fast) && PrintMachineCode) >>>>>>>> PM.add(createMachineFunctionPrinterPass(cerr)); >>>>>>>> + >>>>>>>> + if (SizedMemoryCode) { >>>>>>>> + SizeEmitter * SE = new SizeEmitter(&MCE); >>>>>>>> +...
2010 May 28
4
[LLVMdev] Combining Branch Statements - Missing Optimization Pass?
I have some LLVM IR after the optimization passes defined in createStandardModulePasses with the optimization level set to 3. It contains what appears to me to be an easily optimizable branch statement. In particular, note in the code below that at the end of the "loop" BasicBlock that there is a conditional branch where in the false case, it branches to the label
2008 Apr 07
0
[LLVMdev] Being able to know the jitted code-size before emitting
...lude "llvm/Target/TargetOptions.h" >>>>>>>>> #include "llvm/Transforms/Scalar.h" >>>>>>>>> @@ -257,7 +258,13 @@ >>>>>>>>> >>>>>>>>> if (addPreEmitPass(PM, Fast) && PrintMachineCode) >>>>>>>>> PM.add(createMachineFunctionPrinterPass(cerr)); >>>>>>>>> + >>>>>>>>> + if (SizedMemoryCode) { >>>>>>>>> + SizeEmitter * SE = new SizeEmitter(&MCE); >>>>>&gt...