search for: printmessageaction

Displaying 20 results from an estimated 21 matches for "printmessageaction".

2012 Jun 11
2
[LLVMdev] Why always abort in verifyFunction?
Hello everyone: I have a little question about the second argument *action* of verifyFunction. In docs: *Enumerator: * *AbortProcessAction* verifyModule will print to stderr and abort() *PrintMessageAction* verifyModule will print to stderr and return true *ReturnStatusAction* verifyModule will just return true But it still abort when I pass PrintMessageAction/ReturnStatusAction to function. Log: Basic Block in function 'jitmain' does not have terminator! label %load...
2012 Jun 11
0
[LLVMdev] Why always abort in verifyFunction?
...i Xu <myesis at gmail.com> wrote: > Hello everyone: > > I have a little question about the second argument *action* of > verifyFunction. > > In docs: > > *Enumerator: * *AbortProcessAction* > > verifyModule will print to stderr and abort() > *PrintMessageAction* > > verifyModule will print to stderr and return true > *ReturnStatusAction* > > verifyModule will just return true > > But it still abort when I pass > PrintMessageAction/ReturnStatusAction to function. > > Log: > Basic Block in function 'jitmai...
2007 Dec 26
2
[LLVMdev] Instantiating modules from .bc files
...memBuf = MemoryBuffer::getFile(filename, sizeof filename, &errStr); printf("errStr: %s\n", errStr.c_str()); BitcodeReader::BitcodeReader bcReader(memBuf); Module* Mod = bcReader.materializeModule(&errInfo); printf("errInfo: %s\n", errInfo.c_str()); verifyModule(*Mod, PrintMessageAction); The errStr and the errInfo strings were empty, but I got a crash on the verifyModule call. The filename was produced by running "llvm-gcc -c -emit-llvm tmp.cpp" on the file tmp.cpp, which just contains: #include <stdio.h> typedef struct _whatever { float fa;...
2009 Jun 17
0
[LLVMdev] Segmentation fault - Kaleidoscope
...ays ago (I'm using svn). This may be unrelated to the problem described below, but perhaps it's the same thing. In my case it seems that creating an ExecutionEngine has changed. I used to do Module* Mod = makeLLVMModule(); // basically create a gcd function verifyModule(*Mod, PrintMessageAction); ExecutionEngine *EE; EE = ExecutionEngine::create(Mod); but I now get 0x0 for EE. The compile command I'm using is g++ -O3 -I ~/llvm/include/ -L ~/llvm bug.cpp `llvm-config --cxxflags --ldflags --libs core jit native` -o bug I noticed something very recently changed w.r.t. the way...
2013 Nov 26
2
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...nction); llvm::IRBuilder <> builder(body); llvm::Value * result = builder.CreateBinOp(llvm::Instruction::BinaryOps::Add, llvm::ConstantInt::getSigned(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...
2009 Jun 17
3
[LLVMdev] Segmentation fault - Kaleidoscope
Hello, Following the tutorial "Kaleidoscope: Adding JIT and Optimizer Support", I found a Segmentation fault when I try to execute it. I am new in the neighbourhood, so I don't know what is wrong. Could you help me with that? I am working with the last version of LLVM (2.5). The code in chapter 2 and 3 works good, but the code in the chapter 4 did not work. Below are the detail of
2008 Jan 16
0
[LLVMdev] Cross-module function calls (code included)
...er.h> using namespace llvm; void SetupModules(); Module* mainModule; Module* utilityModule; Function *mainFunction; Function *utilityFunctionPrototype; Function *utilityFunction; int main(int argc, char**argv) { ExecutionEngine *executionEngine; SetupModules(); verifyModule(*mainModule, PrintMessageAction); verifyModule(*utilityModule, PrintMessageAction); PassManager PM; PM.add(new PrintModulePass(&llvm::cout)); PM.run(*mainModule); PM.run(*utilityModule); executionEngine = ExecutionEngine::create(mainModule); executionEngine->addModuleProvider(new ExistingModuleProvider(utilityModu...
2007 Dec 26
0
[LLVMdev] Instantiating modules from .bc files
...lename, sizeof > filename, &errStr); > printf("errStr: %s\n", errStr.c_str()); > BitcodeReader::BitcodeReader bcReader(memBuf); > Module* Mod = bcReader.materializeModule(&errInfo); > printf("errInfo: %s\n", errInfo.c_str()); > > verifyModule(*Mod, PrintMessageAction); > > The errStr and the errInfo strings were empty, but I got a crash on > the verifyModule call. Try this: #include "llvm/Bitcode/ReaderWriter.h" ... std::string &Message; llvm::Module* Mod = llvm::ParseBitcodeFile(MemBuf, &Message); if (!Mod) { // Message con...
2012 Jun 12
2
[LLVMdev] Why always abort in verifyFunction?
...;> Hello everyone: >> >> I have a little question about the second argument *action* of >> verifyFunction. >> >> In docs: >> >> *Enumerator: * *AbortProcessAction* >> >> verifyModule will print to stderr and abort() >> *PrintMessageAction* >> >> verifyModule will print to stderr and return true >> *ReturnStatusAction* >> >> verifyModule will just return true >> >> But it still abort when I pass >> PrintMessageAction/ReturnStatusAction to function. >> >> Log: >&gt...
2013 Nov 28
0
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...;> builder(body); > llvm::Value * result = > builder.CreateBinOp(llvm::Instruction::BinaryOps::Add, > llvm::ConstantInt::getSigned(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 = ...
2007 Dec 27
1
[LLVMdev] Instantiating modules from .bc files
...name, &errStr); >> printf("errStr: %s\n", errStr.c_str()); >> BitcodeReader::BitcodeReader bcReader(memBuf); >> Module* Mod = bcReader.materializeModule(&errInfo); >> printf("errInfo: %s\n", errInfo.c_str()); >> >> verifyModule(*Mod, PrintMessageAction); >> >> The errStr and the errInfo strings were empty, but I got a crash >> on the verifyModule call. > > > Try this: > > #include "llvm/Bitcode/ReaderWriter.h" > > ... > > std::string &Message; > llvm::Module* Mod = llvm::ParseBitcode...
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
2009 Jun 17
10
[LLVMdev] Segmentation fault - Kaleidoscope
...lated to the problem > described below, but perhaps it's the same thing. > > In my case it seems that creating an ExecutionEngine has changed. I > used > to do > > Module* Mod = makeLLVMModule(); // basically create a gcd > function > verifyModule(*Mod, PrintMessageAction); > > ExecutionEngine *EE; > EE = ExecutionEngine::create(Mod); > > but I now get 0x0 for EE. The compile command I'm using is > > g++ -O3 -I ~/llvm/include/ -L ~/llvm bug.cpp `llvm-config --cxxflags > --ldflags --libs core jit native` -o bug > > I noticed so...
2011 Aug 31
2
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
...le* ModMain = makeMainModule(Context, *ModGCD); OwningPtr<tool_output_file> OutGCD (GetOutputStream("gcd.bc")); if (!OutGCD) return 1; OwningPtr<tool_output_file> OutMain (GetOutputStream("maingcd.bc")); if (!OutMain) return 1; verifyModule(*ModGCD, PrintMessageAction); verifyModule(*ModMain, PrintMessageAction); PassManager PM; PM.add(createPrintModulePass(&outs())); PM.run(*ModGCD); PM.run(*ModMain); WriteBitcodeToFile(ModGCD, OutGCD->os()); WriteBitcodeToFile(ModMain, OutMain->os()); OutGCD->keep(); OutMain->keep(...
2012 Jun 17
3
[LLVMdev] BlockAddress instruction is copied instead of cloned during module link?
...ctor.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())); printf("===original==\n"); PM.run(*Mod); Module* ModL = new Module("xL.ll", getGlobalContext()); llvm::Linker::LinkModules(ModL, Mod, Linker::PreserveSource, 0); printf("===linked: before...
2009 Jun 17
0
[LLVMdev] Segmentation fault - Kaleidoscope
...below, but perhaps it's the same thing. > > > > In my case it seems that creating an ExecutionEngine has changed. I > > used > > to do > > > > Module* Mod = makeLLVMModule(); // basically create a gcd > > function > > verifyModule(*Mod, PrintMessageAction); > > > > ExecutionEngine *EE; > > EE = ExecutionEngine::create(Mod); > > > > but I now get 0x0 for EE. The compile command I'm using is > > > > g++ -O3 -I ~/llvm/include/ -L ~/llvm bug.cpp `llvm-config --cxxflags > > --ldflags --libs core j...
2009 Oct 03
1
[LLVMdev] code generation goes into an infinite loop
...ock\n", __FILE__, __LINE__); llvm::BasicBlock *block = llvm::BasicBlock::Create("entry", main_function); llvm::IRBuilder<> builder(block); 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__, __...
2015 May 27
3
[LLVMdev] how to fix this "Expected no forward declarations!" assertion fail
Hello, Everyone I'm using llvm 3.6 DIBuilder module to build the debug information for Chapel language(the Chapel-llvm front end works fine). When I run the test program, I got these assertions failed: !718 Expected no forward declarations! !719 Expected no forward declarations! !720 Expected no forward declarations! !721 Expected no forward declarations! !722 All nodes should be resolved!
2013 May 10
0
[LLVMdev] Simple Loop Vectorize Question
Hi Josh, This line works for me: opt file.ll -loop-vectorize -S -o - -mtriple=x86_64 -mcpu=corei7-avx -debug You need to specify the triple on the command line if it is not inside the module. Thanks, Nadav On May 9, 2013, at 5:53 PM, Joshua Klontz <josh.klontz at gmail.com> wrote: > Nadav, > > Please forgive my ignorance, but 'opt -mcpu=corei7 -loop-vectorize -S
2009 Jan 19
6
[LLVMdev] Load from abs address generated bad code on LLVM 2.4
...oduleProvider.h> #include <llvm/Assembly/PrintModulePass.h> #include <llvm/Support/raw_ostream.h> #include <stdio.h> using namespace llvm; Module *makeLLVMModule (); Function *foo; int main (int argc, char **argv) { Module *Mod = makeLLVMModule (); verifyModule (*Mod, PrintMessageAction); PassManager PM; PM.add (new PrintModulePass ()); PM.run (*Mod); ExecutionEngine *engine = ExecutionEngine ::create(Mod); // DebugFlag = true; // CurrentDebugType = "x86-emitter"; typedef int (*pf)(); pf F = (pf)engine->getPointerToFunction(foo); int res = F();...