search for: materializemodule

Displaying 18 results from an estimated 18 matches for "materializemodule".

2007 Dec 26
2
[LLVMdev] Instantiating modules from .bc files
...gram. I tried to get a module out of a file that I'd read in to it using this code: MemoryBuffer* 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 t...
2010 Feb 11
2
[LLVMdev] LLVM memory usage?
...); builder->setEngineKind(EngineKind::JIT); CodeGenOpt::Level opt_level = CodeGenOpt::Default; builder->setOptLevel(opt_level); execution_engine = builder->create(); delete(builder); // lli doesn't do this - is it safe? } Module *module = mp->materializeModule(&error_message); for (Module::iterator I = module->begin(), E = module->end(); I != E; ++I) { Function *f = &*I; if(!f->isDeclaration()) { execution_engine->getPointerToFunction(f); } } // all functions are compiled so I'd like to dispose of the bitco...
2007 May 12
3
[LLVMdev] reading a module from a memory string (BitCode)
...right way to read a module from a byte array fetched from a database? I thought that I could subclass llbm::module to add my own fields (typically, a MySQL id number) and then parse it as bitcode, but I am stuck, since apparently the only way to parse bitcode is to use a BitcodeReader then calling materializeModule gives a fresh llvm Module (not my subclass) As a general question, are Llvm classes supposed to be usually subclassed to add application data (like my modtime and id), or not... Does any one have some example of reading Bitcode encoded modules? Can I assume that such modules are not tied to a pa...
2013 Jul 29
2
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...eader::ParseConstants() + 339 10 llc 0x00000000006bc634 llvm::BitcodeReader::ParseFunctionBody(llvm::Function*) + 594 11 llc 0x00000000006c2d63 llvm::BitcodeReader::Materialize(llvm::GlobalValue*, std::string*) + 411 12 llc 0x00000000006c290d llvm::BitcodeReader::MaterializeModule(llvm::Module*, std::string*) + 195 13 llc 0x000000000144898e llvm::Module::MaterializeAll(std::string*) + 78 14 llc 0x00000000014489b7 llvm::Module::MaterializeAllPermanently(std::string*) + 29 15 llc 0x00000000006c367b llvm::ParseBitcodeFile(llvm::MemoryBuffer*,...
2007 Dec 26
0
[LLVMdev] Instantiating modules from .bc files
...ut of a file that I'd read in to it using > this code: > > MemoryBuffer* 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. Try this: #include "llvm/Bitcode/ReaderWriter.h" ......
2013 Aug 02
2
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...00000006bc634 >> llvm::BitcodeReader::ParseFunctionBody(llvm::Function*) + 594 >> 11 llc 0x00000000006c2d63 >> llvm::BitcodeReader::Materialize(llvm::GlobalValue*, std::string*) + >> 411 >> 12 llc 0x00000000006c290d >> llvm::BitcodeReader::MaterializeModule(llvm::Module*, std::string*) + >> 195 >> 13 llc 0x000000000144898e >> llvm::Module::MaterializeAll(std::string*) + 78 >> 14 llc 0x00000000014489b7 >> llvm::Module::MaterializeAllPermanently(std::string*) + 29 >> 15 llc 0x000000...
2010 Feb 12
0
[LLVMdev] LLVM memory usage?
...  builder->setOptLevel(opt_level); >       execution_engine = builder->create(); >       delete(builder);       // lli doesn't do this - is it safe? lli allocates the builder on the stack, so it is automatically destroyed on scope exit. >   } > >   Module *module = mp->materializeModule(&error_message); >   for (Module::iterator I = module->begin(), E = module->end(); I != E; ++I) > { >     Function *f = &*I; >     if(!f->isDeclaration()) { >       execution_engine->getPointerToFunction(f); >     } >   } >   // all functions are compiled...
2007 Dec 27
1
[LLVMdev] Instantiating modules from .bc files
...ad in to it using >> this code: >> >> MemoryBuffer* 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. > > > Try this: > > #include...
2013 Aug 02
0
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...10 llc 0x00000000006bc634 > llvm::BitcodeReader::ParseFunctionBody(llvm::Function*) + 594 > 11 llc 0x00000000006c2d63 > llvm::BitcodeReader::Materialize(llvm::GlobalValue*, std::string*) + > 411 > 12 llc 0x00000000006c290d > llvm::BitcodeReader::MaterializeModule(llvm::Module*, std::string*) + > 195 > 13 llc 0x000000000144898e > llvm::Module::MaterializeAll(std::string*) + 78 > 14 llc 0x00000000014489b7 > llvm::Module::MaterializeAllPermanently(std::string*) + 29 > 15 llc 0x00000000006c367b > llvm::Pa...
2010 Oct 25
5
[LLVMdev] llvm-dis fails to parse bytecode emitted by clang
...unsigned int, llvm::Type const*) + 42 8 llvm-dis 0x000000000051482b llvm::BitcodeReader::ParseFunctionBody(llvm::Function*) + 11371 9 llvm-dis 0x000000000051574a llvm::BitcodeReader::materializeFunction(llvm::Function*, std::string*) + 284 10 llvm-dis 0x000000000050ddca llvm::BitcodeReader::materializeModule(std::string*) + 210 11 llvm-dis 0x00000000005171b2 llvm::ParseBitcodeFile(llvm::MemoryBuffer*, std::string*) + 74 12 llvm-dis 0x000000000050b894 main + 160 13 libc.so.6 0x00000039cf41d994 __libc_start_main + 244 14 llvm-dis 0x000000000050b569 __gxx_personality_v0 + 625 Aborted Output for pr...
2013 Aug 09
0
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
...t; llvm::BitcodeReader::ParseFunctionBody(llvm::Function*) + 594 >>> 11 llc 0x00000000006c2d63 >>> llvm::BitcodeReader::Materialize(llvm::GlobalValue*, std::string*) + >>> 411 >>> 12 llc 0x00000000006c290d >>> llvm::BitcodeReader::MaterializeModule(llvm::Module*, std::string*) + >>> 195 >>> 13 llc 0x000000000144898e >>> llvm::Module::MaterializeAll(std::string*) + 78 >>> 14 llc 0x00000000014489b7 >>> llvm::Module::MaterializeAllPermanently(std::string*) + 29 >>> 15...
2010 Oct 26
0
[LLVMdev] llvm-dis fails to parse bytecode emitted by clang
...42 > 8 llvm-dis 0x000000000051482b > llvm::BitcodeReader::ParseFunctionBody(llvm::Function*) + 11371 > 9 llvm-dis 0x000000000051574a > llvm::BitcodeReader::materializeFunction(llvm::Function*, > std::string*) + 284 > 10 llvm-dis 0x000000000050ddca > llvm::BitcodeReader::materializeModule(std::string*) + 210 > 11 llvm-dis 0x00000000005171b2 > llvm::ParseBitcodeFile(llvm::MemoryBuffer*, std::string*) + 74 > 12 llvm-dis 0x000000000050b894 main + 160 > 13 libc.so.6 0x00000039cf41d994 __libc_start_main + 244 > 14 llvm-dis 0x000000000050b569 __gxx_personality_v0 + 6...
2008 Aug 01
0
[LLVMdev] LLVM JIT: How to install a callback for a function loaded in at runtime
Hi Carter, Carter Cheng wrote: > Hello, > > This is probably a bit of a beginner's question but I am new to LLVM > I have been examining the possibility of constructing something similar to the JnJVM for a language which supports dynamic class loading. The problem I am having is determining how the JIT system allows for dynamic loading of functions into the JIT. The paper
2007 May 12
0
[LLVMdev] reading a module from a memory string (BitCode)
...ated, you load it like any other bitcode stream. > I thought that I could subclass llbm::module to add my own fields > (typically, a MySQL id number) and then parse it as bitcode, but I am stuck, > since apparently the only way to parse bitcode is to use a BitcodeReader > then calling materializeModule gives a fresh llvm Module (not my subclass) Right, don't do that :). There are three easy ways to do this sort of thing: 1) add intrinsics to capture the information you want, 2) encode the information as global variable initializers (as we do with debug info) 3) store it out-of-band, as r...
2008 Jul 31
3
[LLVMdev] LLVM JIT: How to install a callback for a function loaded in at runtime
Hello, This is probably a bit of a beginner's question but I am new to LLVM I have been examining the possibility of constructing something similar to the JnJVM for a language which supports dynamic class loading. The problem I am having is determining how the JIT system allows for dynamic loading of functions into the JIT. The paper indicates the JnJVM use some sort of callback when the JIT
2010 Oct 26
2
[LLVMdev] llvm-dis fails to parse bytecode emitted by clang
...000000000051482b >> llvm::BitcodeReader::ParseFunctionBody(llvm::Function*) + 11371 >> 9   llvm-dis  0x000000000051574a >> llvm::BitcodeReader::materializeFunction(llvm::Function*, >> std::string*) + 284 >> 10  llvm-dis  0x000000000050ddca >> llvm::BitcodeReader::materializeModule(std::string*) + 210 >> 11  llvm-dis  0x00000000005171b2 >> llvm::ParseBitcodeFile(llvm::MemoryBuffer*, std::string*) + 74 >> 12  llvm-dis  0x000000000050b894 main + 160 >> 13  libc.so.6 0x00000039cf41d994 __libc_start_main + 244 >> 14  llvm-dis  0x000000000050b569 __gx...
2011 Jun 11
0
[LLVMdev] Kaleidoscope Build Error
...undefined reference to `std::basic_string<char, > std::char_traits<char>, std::allocator<char> >>::_Rep::_M_destroy(std::allocator<char> const&)' > /homes/malecha/tmp/llvm/lib/ocaml/libLLVMBitReader.a(BitcodeReader.o): In > function `llvm::BitcodeReader::MaterializeModule(llvm::Module*, > std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)': > BitcodeReader.cpp:(.text+0x1eb): undefined reference to `operator > delete(void*)' > /homes/malecha/tmp/llvm/lib/ocaml/libLLVMBitReader.a(BitcodeReader.o): In > fun...
2006 May 09
1
[LLVMdev] Memory leaks in LLVM
...tecodeReader::ParseCompactionTable() ( Reader.cpp:1278) ==10132== by 0x83E4AB6: llvm::BytecodeReader::ParseFunctionBody(llvm::Function*) (Reader.cpp:1828) ==10132== by 0x83E53D0: llvm::BytecodeReader::ParseAllFunctionBodies() ( Reader.cpp:1981) ==10132== by 0x8406354: llvm::BytecodeReader::materializeModule() ( Reader.h:167) ==10132== by 0x84074C9: llvm::ModuleProvider::releaseModule() ( ModuleProvider.h:53) ==10132== by 0x8406370: llvm::BytecodeReader::releaseModule() (Reader.h :177) ==10132== by 0x83EA353: llvm::ParseBytecodeFile(std::string const&, std::string*) ( ReaderWrappers.cpp:29...