search for: parsebitcodefile

Displaying 20 results from an estimated 72 matches for "parsebitcodefile".

2014 Feb 21
3
[LLVMdev] Status of http://llvm.org/doxygen
...hat http://llvm.org/doxygen seems to be out-of-date. The footer shows that the files are regenerated everyday. I guess that the input repository for doxygen has not been updated for a while. For example, http://llvm.org/doxygen/namespacellvm.html#adeb6bbe8b1bed333ee7608e1939153c0 It says llvm::ParseBitcodeFile() has following prototype: Module *ParseBitcodeFile(MemoryBuffer *Buffer, LLVMContext &Context, std::string *ErrMsg = 0); However, from the subversion log, it seem that it have been changed to: ErrorOr<Module *> parseBitcodeFile(MemoryBuffer *Buffer, LLVMContext &Context);...
2014 Mar 19
2
[LLVMdev] load bytecode from string for jiting problem
...;lsr: " << lsr << "\n"; llvm::MemoryBuffer* mbjit = llvm::MemoryBuffer::getMemBufferCopy (lsr); have same result as invalid bit code. The result of valgrind, effectively, i have invalid reads in the parseBitcodeFile: ==536== Conditional jump or move depends on uninitialised value(s) ==536== at 0x501FE3: llvm::BitstreamCursor::Read(unsigned int) (in /home/willy/blah_test_script/new_blah/simple_scev_dynamic_array) ==536== by 0x501A19: llvm::BitcodeReader::ParseBitcodeInto(llvm::Module*) (in /home/willy/bl...
2014 Mar 20
2
[LLVMdev] load bytecode from string for jiting problem
..."0xc0 ok\n"; if (sr.str()[3] == (char) 0xde) std::cout << "0xde ok\n"; llvm::MemoryBuffer* mbjit = llvm::MemoryBuffer::getMemBufferCopy (sr); llvm::ErrorOr<llvm::Module*> ModuleOrErr = llvm::parseBitcodeFile (mbjit, context); if (llvm::error_code EC = ModuleOrErr.getError()) { std::cout << ModuleOrErr.getError().message() << "\n"; } Module* Mjit = ModuleOrErr.get(); std::string eeError; ExecutionEngine* nee = EngineBuilder(Mjit).setEngineKind(EngineKind::JIT).setUseMCJIT(...
2014 Mar 20
2
[LLVMdev] load bytecode from string for jiting problem
...00004fa8c8 in llvm::BitstreamCursor::Read(unsigned int) () > #1 0x00000000004fa1d2 in llvm::BitcodeReader:: > ParseBitcodeInto(llvm::Module*) () > #2 0x0000000000503ae9 in llvm::getLazyBitcodeModule(llvm::MemoryBuffer*, > llvm::LLVMContext&) () > #3 0x0000000000503eb6 in llvm::parseBitcodeFile(llvm::MemoryBuffer*, > llvm::LLVMContext&) () > #4 0x00000000004ec195 in jitter (skeletons=<optimized out>, > params=0x7fffffffdf40, phi_state=0x11adbc0, lower=0, upper=250, > inst_outer=8, inst_inner=<optimized out>) > at /home/willy/hello_stuff/with_apollo/simp...
2014 Mar 19
2
[LLVMdev] load bytecode from string for jiting problem
...gt; and after read/parse it for unsing on a jit. >> >> I write a pass to export function to module, and put this module inside >> a global variable. >> I use WriteBitcodeToFile for this. >> For debuging, after this write, I try to load the exported module with >> parseBitcodeFile. >> This two step works. >> >> >> >> After, while the compiled program is running, I try to read and parse >> this global variable for jiting the function. >> >> 1) I read the global variable with >> StringRef sr (gv, gv_length); >> &gt...
2011 Feb 24
2
[LLVMdev] Valgrind memcheck errors in llvm
...(StringRef.h:176) ==24227== by 0x9D22519: llvm::Module::Module(llvm::StringRef, llvm::LLVMContext&) (Module.cpp:61) ==24227== by 0x99FCD1D: llvm::getLazyBitcodeModule(llvm::MemoryBuffer*, llvm::LLVMContext&, std::string*) (BitcodeReader.cpp:2641) ==24227== by 0x99FCDF8: llvm::ParseBitcodeFile(llvm::MemoryBuffer*, llvm::LLVMContext&, std::string*) (BitcodeReader.cpp:2660) ==24227== Mismatched free() / delete / delete [] ==24227== at 0x40257ED: free (vg_replace_malloc.c:366) ==24227== by 0x9D765EF: llvm::ExecutionEngine::~ExecutionEngine() (ExecutionEngine.cpp:74) ==24227==...
2014 Jan 10
4
[LLVMdev] Bitcode parsing performance
...I suspect it's due to debug info. My stdlib is currently about 2kloc in a number of C++ files; I compile them with clang -g -emit-llvm, then link them together with llvm-link, call opt -O3 on it, and arrive at a 1MB bitcode file. I then embed this as a binary blob into my executable, and call ParseBitcodeFile on it at startup. Unfortunately, this parsing takes about 60ms right now, which is the main component of my ~100ms time to run on an empty source file (another ~20ms is loading the pre-jit'd image through an ObjectCache). I thought I'd save some time by using getLazyBitcodeModule, since t...
2014 Mar 13
2
[LLVMdev] load bytecode from string for jiting problem
...ird problem while writing a bytecode module to a string, and after read/parse it for unsing on a jit. I write a pass to export function to module, and put this module inside a global variable. I use WriteBitcodeToFile for this. For debuging, after this write, I try to load the exported module with parseBitcodeFile. This two step works. After, while the compiled program is running, I try to read and parse this global variable for jiting the function. 1) I read the global variable with StringRef sr (gv, gv_length); 2) I manually test this bytecode by (inspired by inline bool isRawBitcode(const unsigned...
2014 Jan 20
2
[LLVMdev] MCJIT versus getLazyBitcodeModule?
...ved! So it seems that it's an issue of whether or not the underscore prefix is included when looking up the function from the module, and old JIT and MCJIT disagree. Furthermore, if I change the creation of the module from using llvm::getLazyBitcodeModule to this: llvm::Module *m = llvm::ParseBitcodeFile (buf, context(), err); it works just fine. But of course, I'd really like to deserialize this bitcode file lazily, because it's got a ton of functions potentially called by my IR, but any given bit of code that I'm JITing only uses a tiny subset, so the JIT speed has greatly reduced o...
2013 Dec 17
0
[LLVMdev] llvmContext::removeModule doesn't remove NamedStructTypes
...g; string filename = "wrapper.bc"; llvm::OwningPtr<llvm::MemoryBuffer> File; if (llvm::MemoryBuffer::getFileOrSTDIN(filename, File)) { assert(0); } llvm::MemoryBuffer * buffer = File.take(); { llvm::OwningPtr<llvm::Module> module(llvm::ParseBitcodeFile(buffer, llvmCtx, &ErrMsg)); module->dump(); } { llvm::OwningPtr<llvm::Module> module(llvm::ParseBitcodeFile(buffer, llvmCtx, &ErrMsg)); module->dump(); } } with smart pointer, the 1st module will be deleted and call removeModule for the co...
2014 Jan 10
3
[LLVMdev] Bitcode parsing performance
...ue to debug info. My stdlib > is currently about 2kloc in a number of C++ files; I compile them with > clang -g -emit-llvm, then link them together with llvm-link, call opt -O3 > on it, and arrive at a 1MB bitcode file. I then embed this as a binary > blob into my executable, and call ParseBitcodeFile on it at startup. > > Unfortunately, this parsing takes about 60ms right now, which is the main > component of my ~100ms time to run on an empty source file (another ~20ms > is loading the pre-jit'd image through an ObjectCache). I thought I'd save > some time by using getLa...
2014 Jan 23
2
[LLVMdev] Bitcode parsing performance
...t; stdlib is currently about 2kloc in a number of C++ files; I compile them >>> with clang -g -emit-llvm, then link them together with llvm-link, call opt >>> -O3 on it, and arrive at a 1MB bitcode file. I then embed this as a binary >>> blob into my executable, and call ParseBitcodeFile on it at startup. >>> >>> Unfortunately, this parsing takes about 60ms right now, which is the >>> main component of my ~100ms time to run on an empty source file (another >>> ~20ms is loading the pre-jit'd image through an ObjectCache). I thought >>&g...
2016 Feb 10
3
Question about an error we're now starting to get on LLVM 3.8.0rc2since
On Wed, Feb 10, 2016 at 10:50 AM, Mehdi Amini via llvm-dev <llvm-dev at lists.llvm.org> wrote: >>> Is this change indeed intended as a visible API change to source code generating references to argument list values? If so, can you point me to a description of how I should change our code? Should I bug someone else about this problem? Should this API change be documented in
2016 Oct 26
2
RFC: APIs for bitcode files containing multiple modules
...a next() member function which would move to the next module in the file. For example: BitcodeReader R(MBRef); Expected<bool> B = R.hasGlobalValueSummary(); std::unique_ptr<Module> M1 = R.getLazyModule(Ctx); // lazily load the first module R.next(); std::unique_ptr<Module> M2 = R.parseBitcodeFile(Ctx); // eagerly load the second module We'd continue to support the existing functional APIs in ReaderWriter.h for convenience in the common case where the bitcode file has a single module. Thanks, -- -- Peter -------------- next part -------------- An HTML attachment was scrubbed... URL:...
2008 Oct 03
0
[LLVMdev] memory leaks in *Type::get() and Constant*::get()
...DDB1: llvm::BitcodeReader::ParseModule(std::string const&) (BitcodeReader.cpp:1078) by 0x85EF35F: llvm::BitcodeReader::ParseBitcode() (BitcodeReader.cpp:1367) by 0x85EF40B: llvm::getBitcodeModuleProvider(llvm::MemoryBuffer*, std::string*) (BitcodeReader.cpp:2078) by 0x85EF483: llvm::ParseBitcodeFile(llvm::MemoryBuffer*, std::string*) (BitcodeReader.cpp:2094) by 0x839ADFF: main (opt.cpp:432) 160 bytes in 4 blocks are definitely lost in loss record 18 of 20 at 0x4023614: operator new(unsigned) (in vgpreload_memcheck.so) by 0x867EF30: llvm::User::operator new(unsigned, unsigned) (Val...
2012 Feb 03
2
[LLVMdev] Invalid bitcode signature
...and one that's being generated from the source language. If I have something like this: OwningPtr<MemoryBuffer> owning_ptr; if (MemoryBuffer::getFile(StringRef("../hello.bc"), owning_ptr)) std::cout << "error opening file" << std::endl; Module* Lib = ParseBitcodeFile(owning_ptr.get(), context, &error); if (!Lib) std::cout << error << std::endl; When I run this (either on a bitcode file generated by llvm-gcc or by createBitcodeWriterPass()) I get an error telling me: "invalid bitcode signature". I'm not sure where this error...
2013 Jan 29
0
[LLVMdev] Running a Local Buildbot
Hello We are migrating from 2.9 to 3.2 Here is some code that does not compile any more llvm::PassManager *pm; llvm::FunctionPassManager *fpm; module = llvm::ParseBitcodeFile(mb,context,&err_str); if (!module) { error() <<"Failed to load module from bitcode file: " <<err_str <<endl; exit(1); } pm = new PassManager(); pm->add(createAlwaysInlinerPass()); fpm = new FunctionPassManager(module);...
2007 Jul 13
0
[LLVMdev] llvm-gcc-4-2 development branch is open
...nking the LLVM libraries into a dynamic @@ -40,8 +41,10 @@ void dummy_function() { new llvm::ExistingModuleProvider(0); llvm::createVerifierPass(); - llvm::WriteBitcodeToFile(0, llvm::cout); + llvm::CreateBitcodeWriterPass(*llvm::cout); + llvm::WriteBitcodeToFile(0, *llvm::cout); llvm::ParseBitcodeFile(NULL); + llvm::MemoryBuffer::getNewMemBuffer(0); llvm::createInstructionCombiningPass(); llvm::createScalarReplAggregatesPass();
2007 Jul 14
0
[LLVMdev] llvm-gcc-4-2 development branch is open
...tecode -> Bitcode. My guess is the Evan's change didn't reach the mirror. Here is the function as it exists in the llvm-gcc-4.0 mirror today: void dummy_function() { new llvm::ExistingModuleProvider(0); llvm::createVerifierPass(); llvm::WriteBitcodeToFile(0, llvm::cout); llvm::ParseBitcodeFile(NULL); ... and in llvm-gcc-4.2: void dummy_function() { new llvm::ExistingModuleProvider(0); llvm::createVerifierPass(); llvm::CreateBitcodeWriterPass(*llvm::cout); llvm::WriteBitcodeToFile(0, *llvm::cout); llvm::ParseBitcodeFile(NULL); llvm::MemoryBuffer::getNewMemBuffer(0); If the l...
2007 Jul 13
2
[LLVMdev] llvm-gcc-4-2 development branch is open
On Jul 13, 2007, at 9:28 AM, Duncan Sands wrote: > Hi Chris, > >> This is probably a patch that got checked into llvm-gcc4 after devang >> started work on 4.2. Please feel free to update 4.2 to the version >> in >> 4.0. > > no, it doesn't exist in 4.0. hmm. that can not be true. It was applied by Evan on May 07, 2007 to unbreak Apple style builds. -