search for: createprintmodulepass

Displaying 20 results from an estimated 22 matches for "createprintmodulepass".

2009 May 12
1
[LLVMdev] Tutorial 1: casting cout
To get Tutorial 1 to compile, I had to cast cout as a raw_osstream, as in: PM.add(createPrintModulePass(&llvm::cout)); ----> PM.add(createPrintModulePass((raw_ostream*)&llvm::cout)); I was getting the following error: $ c++ -g tut1.cpp `llvm-config --cxxflags --ldflags --libs core` -o tut1 tut1.cpp: In function ‘int main(int, char**)’: tut1.cpp:19: error: cannot convert ‘llvm::OStream...
2013 Nov 28
0
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...:getSigned(functionType, 2)); > builder.CreateRet(result); > > llvm::verifyModule(module, llvm::PrintMessageAction); > > std::string errorInfo; > llvm::raw_fd_ostream fileStream("test.ll", errorInfo); > > llvm::PassManager pm; > pm.add(llvm::createPrintModulePass(& fileStream)); > pm.run(module); > > And here is the result: > > ; ModuleID = 'test' > > define i16 @foo() { > __entry__: > ret i16 42 > } > > > (Somehow I am beginning to get the feeling that operations on literals > a...
2013 Nov 26
2
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...d(functionType, 40), llvm::ConstantInt::getSigned(functionType, 2)); builder.CreateRet(result); llvm::verifyModule(module, llvm::PrintMessageAction); std::string errorInfo; llvm::raw_fd_ostream fileStream("test.ll", errorInfo); llvm::PassManager pm; pm.add(llvm::createPrintModulePass(& fileStream)); pm.run(module); And here is the result: ; ModuleID = 'test' define i16 @foo() { __entry__: ret i16 42 } (Somehow I am beginning to get the feeling that operations on literals are always evaluated at compile-time and that this can not be pre...
2016 Feb 16
2
LLVM IR to C++
Hi, I want to convert LLVM bitcode files to cpp. I use these commands: 1. clang -c -emit-llvm -fopenmp=libiomp5 oh2.c -o oh2.bc2. llc -march=cpp oh2.bc -o oh2.cpp3. g++ -fno-rtti -O0 -g `$HOME/llvmbuild/bin/llvm-config --cxxflags` oh2.cpp `$HOME/llvmbuild/bin/llvm-config --ldflags --libs --system-libs` -o oh2c After the 3rd command, I get a lot of compilation errors. Is it possible that llc
2010 Mar 30
2
[LLVMdev] [PATCH] Before/After IR Dumps
On Monday 29 March 2010 13:20:37 Chris Lattner wrote: > > How should we handle the llvm-gcc and clang changes? > > What changes are required? Attached. They are trivial. > You have access to all llvm repositories, including clang and llvm-gcc. Ok. Is there are preferred order to commit things? I think I'm ready to go.
2010 Mar 30
0
[LLVMdev] [PATCH] Before/After IR Dumps
...12:27 PM, David Greene wrote: > On Monday 29 March 2010 13:20:37 Chris Lattner wrote: > >>> How should we handle the llvm-gcc and clang changes? >> >> What changes are required? > > Attached. They are trivial. Why not just change the order of the arguments to createPrintModulePass, and make the string default to ""? -Chris
2012 Feb 29
1
[LLVMdev] how to remove inlined function
...using clang/llvm 3.0 release and I have a module that is generated by clang with some functions declared as inline. after inlining (llvm::createFunctionInliningPass) I'd like to remove the functions that were inlined. how can this be done? surprisingly they are removed if a print pass (llvm::createPrintModulePass) is present. is there an explanation for this? -Jochen
2012 Nov 01
3
[LLVMdev] Adding comments to generated IR
I'm using createPrintModulePass to produce the IR of a created Module. I'm wondering if there is some way to insert/attach comments to the generated output. That is, prior to a given command, or block, emit a comment. I see the ability to add meta/debug data. Could that somehow be used to get comments into the generated IR?...
2010 Mar 26
0
[LLVMdev] [PATCH] Before/After IR Dumps
...m anyone? This is looking much better, thanks. I'd still prefer using StringRef instead of std::string here because it cleans up the interface, but I won't insist. Please don't do this though: + bool runOnSCC(std::vector<CallGraphNode *> &SCC) { + ModulePass *Printer = createPrintModulePass(Banner, &Out); + Printer->runOnModule(*M); + delete Printer; + return false; It would be better to just loop over the callgraphnodes and call F->print(Out) on the functions for each node. If you'd prefer, you can just emit "not implemented for CGSCC nodes yet" if...
2010 Mar 17
4
[LLVMdev] [PATCH] Before/After IR Dumps
On Monday 15 March 2010 13:45:14 David Greene wrote: > On Sunday 14 March 2010 18:32:35 Chris Lattner wrote: > > This is much better than the first iteration but still has many issues. I believe I've addressed all your points with this patch except I didn't use StringRef. It doesn't appear to be useful since createPrinterPass will be sent a const std::string & and will
2012 Jun 17
3
[LLVMdev] BlockAddress instruction is copied instead of cloned during module link?
...; #include <llvm/Assembly/PrintModulePass.h> #include <llvm/Linker.h> #include <algorithm> using namespace llvm; Module* makeLLVMModule(); int main(int argc, char**argv) { Module* Mod = makeLLVMModule(); verifyModule(*Mod, PrintMessageAction); PassManager PM; PM.add(createPrintModulePass(&outs())); printf("===original==\n"); PM.run(*Mod); Module* ModL = new Module("xL.ll", getGlobalContext()); llvm::Linker::LinkModules(ModL, Mod, Linker::PreserveSource, 0); printf("===linked: before original delete==\n"); PM.run(*ModL); dele...
2012 Nov 01
0
[LLVMdev] Adding comments to generated IR
Hi edA-qa mort-ora-y, On 01/11/12 09:03, edA-qa mort-ora-y wrote: > I'm using createPrintModulePass to produce the IR of a created Module. > I'm wondering if there is some way to insert/attach comments to the > generated output. That is, prior to a given command, or block, emit a > comment. > > I see the ability to add meta/debug data. Could that somehow be used to > get com...
2010 Mar 14
3
[LLVMdev] [PATCH] Before/After IR Dumps
...6 +18,7 @@ #define LLVM_PASSMANAGER_H #include "llvm/Pass.h" +#include "llvm/Support/PassNameParser.h" namespace llvm { +Pass *CallGraphSCCPass::getPrinterPass(raw_ostream &O, + const std::string &Banner) const { + return createPrintModulePass(Banner, &O); +} This isn't correct at all, this should return a CGSCCPass as a printer. Adding a Module pass will change the ordering of passes in the passmanager, which will cause your option to completely change behavior of the optimization sequence. +Pass *LoopPass::getPrinterPass(raw...
2009 Oct 03
1
[LLVMdev] code generation goes into an infinite loop
...ck); builder.CreateRet(arg1); // verify the module printf("%s:%d verify\n", __FILE__, __LINE__); verifyModule(*mod, llvm::PrintMessageAction); // render the module printf("%s:%d render\n", __FILE__, __LINE__); llvm::PassManager PM; llvm::ModulePass *pmp = llvm::createPrintModulePass(0); // (&llvm::cout); PM.add(pmp); PM.run(*mod); // delete the module printf("%s:%d delete module\n", __FILE__, __LINE__); delete mod;
2010 May 13
2
[LLVMdev] Handling of thread_local globals by llc -march=cpp
...var_int32_a->setInitializer(const_int32_2); As you can see no actual parameter is provided for the optional formal ThreadLocal parameter of the GlobalVariable constructor; it instead then gets the default value of false. Compiling the cpp file and executing it to check the output of running the createPrintModulePass confirms that the llvm IR produced does not create a thread local global variable: ; ModuleID = 'thread_local.s' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" target triple = &q...
2010 Mar 29
2
[LLVMdev] [PATCH] Before/After IR Dumps
...to manage the type conversions? The alternative is to move all interfaces over to StringRef but I don't think that's in the scope of this patch. > Please don't do this though: > > + bool runOnSCC(std::vector<CallGraphNode *> &SCC) { > + ModulePass *Printer = createPrintModulePass(Banner, &Out); > + Printer->runOnModule(*M); > + delete Printer; > + return false; > > It would be better to just loop over the callgraphnodes and call > F->print(Out) on the functions for each node. If you'd prefer, you can > just emit "not impleme...
2010 Mar 12
0
[LLVMdev] [PATCH] Before/After IR Dumps
On Friday 12 March 2010 08:13:05 Kalle Raiskila wrote: > David Greene wrote: > > Here's a rework using PassManager as Chris suggested. Comments? > > Tried this second patch with the svn version 97812 (the one the patch is > made against), but it doesn't compile: > "llvm/include/llvm/Pass.h:127: Error: expected unqualified-id before "&" >
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 Mar 12
2
[LLVMdev] [PATCH] Before/After IR Dumps
David Greene wrote: > Here's a rework using PassManager as Chris suggested. Comments? Tried this second patch with the svn version 97812 (the one the patch is made against), but it doesn't compile: "llvm/include/llvm/Pass.h:127: Error: expected unqualified-id before "&" token" Seems raw_ostream is forward declared but not defined (adding a missing #include
2010 Mar 15
0
[LLVMdev] [PATCH] Before/After IR Dumps
...; #include "llvm/Pass.h" > +#include "llvm/Support/PassNameParser.h" > > namespace llvm { > > > > +Pass *CallGraphSCCPass::getPrinterPass(raw_ostream &O, > + const std::string &Banner) const { > + return createPrintModulePass(Banner, &O); > +} > > This isn't correct at all, this should return a CGSCCPass as a printer. > Adding a Module pass will change the ordering of passes in the passmanager, > which will cause your option to completely change behavior of the > optimization sequence. Which...