search for: printmodulepass

Displaying 20 results from an estimated 41 matches for "printmodulepass".

2005 Jun 10
2
[LLVMdev] Problems with void*
...o use the LLVM classes (with Modules in memory) to represent some programs that use the void* type but I am having some problems handling that type. If I use WriteBytecodeToFile, I receive this error: Assertion `slot != -1 && "Module broken!"` If I save the module directly with PrintModulePass, it generates the .ll file fine, but if I try to compile it with llvm-as, as soon as it finds 'void *' it complains that it was expecting an "(" instead of an "*". I suppose that the correct syntax is something like this: 'void (sbyte *)*' For example, these li...
2011 Aug 31
2
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
Hi, I tried this as well, using the following line to add function declaration to the caller module. Function::Create(FT, Function::ExternalLinkage, "gcd", mod); Where "FT" is the same as before. And the output produced by the PrintModulePass becomes: ; ModuleID = 'GCDMain' declare i32 @gcd(i32, i32) define i32 @main() { EntryBlock: %tmp = call i32 @gcd(i32 30, i32 50) ret i32 %tmp } But it still fails to WriteBitcodeToFile, and produces the same error as before. I guess I might be missing some attribute, like "...
2006 Nov 30
0
[LLVMdev] Conditional jump or move depends on uninitialised value
llvm-gcc is producing segmentation fault when running with -emit-llvm. Running cc1 in valgind produces the warning: ==12768== at 0x8D042C: llvm::llvm_ostream& llvm::llvm_ostream::operator<< <llvm::Module>(llvm::Module const&) (Streams.h:41) ==12768== by 0x8D0464: llvm::PrintModulePass::runOnModule(llvm::Module&) (PrintModulePass.h:41) ==12768== by 0xED6EB9: llvm::ModulePassManager::runPass(llvm::ModulePass*, llvm::Module*) (PassManagerT.h:849) ==12768== by 0xEED05F: llvm::PassManagerT<llvm::MTraits>::runPasses(llvm::Module*, std::map<llvm::Pass*, std::vector&l...
2010 Mar 14
3
[LLVMdev] [PATCH] Before/After IR Dumps
...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...
2008 Jan 16
0
[LLVMdev] Cross-module function calls (code included)
...y functions. Here's the code: #include <llvm/Module.h> #include <llvm/ModuleProvider.h> #include <llvm/Function.h> #include <llvm/PassManager.h> #include <llvm/ExecutionEngine/ExecutionEngine.h> #include <llvm/Analysis/Verifier.h> #include <llvm/Assembly/PrintModulePass.h> #include <llvm/Support/LLVMBuilder.h> using namespace llvm; void SetupModules(); Module* mainModule; Module* utilityModule; Function *mainFunction; Function *utilityFunctionPrototype; Function *utilityFunction; int main(int argc, char**argv) { ExecutionEngine *executionEngine; Se...
2011 Aug 31
0
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
...wrote: > Hi, > > I tried this as well, using the following line to add function declaration > to the caller module. > > Function::Create(FT, Function::ExternalLinkage, "gcd", mod); > > Where "FT" is the same as before. And the output produced by the > PrintModulePass becomes: > > ; ModuleID = 'GCDMain' > > declare i32 @gcd(i32, i32) > > define i32 @main() { > EntryBlock: >  %tmp = call i32 @gcd(i32 30, i32 50) >  ret i32 %tmp > } > > But it still fails to WriteBitcodeToFile, and produces the same error as > before....
2009 Oct 03
1
[LLVMdev] code generation goes into an infinite loop
...nt the simplest possible code generation. Specifically, we are trying to emit code for the following program, as it is easily testable from the command-line: int main(int argc) { return argc; } We got our code generator to build and link with llvm. When we run it, it pauses when running the PrintModulePass and then exits with a bus error. I suspect that this is an infinite loop leading to a stack overflow. While many kinds of errors we could fix by looking at other people's examples or reading the docs, I suspect that this should be considered to be a bug in the verifier pass: clearly we genera...
2005 Jun 10
0
[LLVMdev] Problems with void*
...odules in memory) to represent some programs that use > the void* type but I am having some problems handling that type. > If I use WriteBytecodeToFile, I receive this error: > > Assertion `slot != -1 && "Module broken!"` > > If I save the module directly with PrintModulePass, it generates the .ll file fine, but if I try > to compile it with llvm-as, as soon as it finds 'void *' it complains that it was expecting an "(" > instead of an "*". I suppose that the correct syntax is something like this: 'void (sbyte *)*' > > F...
2009 Jan 19
6
[LLVMdev] Load from abs address generated bad code on LLVM 2.4
...of a bug-fix release for LLVM 2.4, or should I just use LLVM trunk until LLVM 2.5 ? Andrew. #include <llvm/Module.h> #include <llvm/Function.h> #include <llvm/PassManager.h> #include <llvm/CallingConv.h> #include <llvm/Analysis/Verifier.h> #include <llvm/Assembly/PrintModulePass.h> #include <llvm/Support/IRBuilder.h> #include <llvm/Support/Debug.h> #include <llvm/ExecutionEngine/ExecutionEngine.h> #include <llvm/ModuleProvider.h> #include <llvm/Assembly/PrintModulePass.h> #include <llvm/Support/raw_ostream.h> #include <stdio.h>...
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 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
...clude "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...
2020 Jul 14
3
[RFC] Introducing classes for the codegen driven by new pass manager
...> > Are doInitialization/doFinalization really necessary? As mentioned in the > previous discussion, it seems like usually the things in > doInitialization/doFinalization are not logically in the right place. > For example, maybe PrintMIRPass should just be a module pass, like > PrintModulePass. Good point! It is very likely that PrintMIRPass could be implemented with (4) above. For AsmPrinter's uses of ` doInitialization`, I'm not 100% sure. It looks like it could also be replaced by (4). But difference is ` doInitialization` is invoked before all passes `run` method, whereas (...
2012 Jun 17
3
[LLVMdev] BlockAddress instruction is copied instead of cloned during module link?
...#include <llvm/InlineAsm.h> #include <llvm/Support/FormattedStream.h> #include <llvm/Support/MathExtras.h> #include <llvm/Pass.h> #include <llvm/PassManager.h> #include <llvm/ADT/SmallVector.h> #include <llvm/Analysis/Verifier.h> #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())); pri...
2011 Aug 31
0
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
On Wed, Aug 31, 2011 at 10:00 AM, Mian M. Hamayun <mian-muhammad.hamayun at imag.fr> wrote: > Hello Everyone, > > I am trying to create two modules in LLVM, where first module contains the > definition of a function, gcd in this example and another module contains a > call to this function. You can't reference a global in one module in another module. Either stick with
2013 Nov 26
0
[LLVMdev] Help needed with a pass
...ib.h>#include <stdio.h>#include "llvm/Pass.h"#include "llvm/IR/Function.h"#include "llvm/Support/raw_ostream.h"#include "llvm/IR/Module.h"#include "llvm/PassManager.h"#include "llvm/Analysis/Verifier.h"#include "llvm/Assembly/PrintModulePass.h"#include "llvm/IR/IRBuilder.h" using namespace llvm; Module* makeLLVMModule() { Module* mod = new Module(getGlobalContext()); Function* strncpy_func = cast<Function>(mod->getOrInsertFunction(new StringRef("strncpy"), Type::getInt32Ty(getGlobalContext()),...
2013 Apr 29
1
[LLVMdev] Many tests fail on Win64
I fell over this issue yesterday myself with lots of asserts being thrown. I think the issue is in lib/IR/AsmWriter.cpp:1618 in the function AssemblyWriter::printFunction(const Function *F) Looking at the code I think the 2nd for loop should be preceded by the test ... if (Idx < AS.getNumSlots()) Not sure why it doesn't fail on other platforms as it looks like it should be a genuine
2020 Jul 11
2
[RFC] Introducing classes for the codegen driven by new pass manager
(NPM: new pass manager; LPM: legacy pass manager) Hello, community While we're still working towards using NPM for optimizer pipeline by default, we still don't have a machine pass interface and the corresponding machine pass manager using NPM. The potential benefits using NPM aside, this inhibits us from making any progress on deprecating LPM for the codegen pipeline which blocks
2007 May 18
2
[LLVMdev] Antw.: 2.0 Pre-release tarballs online
...exit 1; fi In file included from /home/bram/workspace/svn/aspicere2/trunk/llvm/ include/llvm/Function.h:22, from /home/bram/workspace/svn/aspicere2/trunk/llvm/ include/llvm/Module.h:17, from /home/bram/workspace/svn/aspicere2/trunk/llvm/ include/llvm/Assembly/PrintModulePass.h:22, from /home/bram/workspace/svn/aspicere2/trunk/llvm/ lib/VMCore/AsmWriter.cpp:18: /home/bram/workspace/svn/aspicere2/trunk/llvm/include/llvm/ BasicBlock.h: In static member function `static unsigned int llvm::BasicBlock::getInstListOffset()': /home/bram/workspac...
2007 May 18
0
[LLVMdev] Antw.: 2.0 Pre-release tarballs online
> On Slackware 10.2 (GCC 3.3.6), I got an error during a debug build with the > header files using uintptr_t (not recognised as a type). Putting "#include > <stdint.h>" in include/llvm/BasicBlock.h (llvm) and in > "include/llvm/ValueSymbolTable.h" (frontend) resolved this. Ok. This is now fixed on the release branch. Thanks! > Also, I got linking