search for: parseirfiles

Displaying 20 results from an estimated 39 matches for "parseirfiles".

Did you mean: parseirfile
2018 Jun 12
2
Proper method to initialize all LLVM Internal Data Structures?
Hi: I'm building a small tool on top of LLVM Core Library. ``` LLVMContext context; SMDiagnostic diag; Module *M = parseIRFile(InputIR, diag, context).get(); if (M == nullptr) { diag.print("LLVM", errs()); exit(-1); } assert(M->isMaterialized() && "Module not materialized!"); PointerType *ArrayPtrTy =
2018 Feb 17
0
Proper way to load pre-generated LLVM IR into JIT module and dedup type definitions?
What is the proper way to load a set of pre-generated LLVM IR and make it available to runtime JIT modules such that the same types aren't given new names and inlining and const propagation can still take place?   My attempt so far: I compile a set of C functions to LLVM IR offline via 'clang -c -emit-llvm -S -ffast-math -msse2 -O3 -o MyLib.ll MyLib.c' For each runtime JIT module, I
2012 Oct 22
2
[LLVMdev] Reading IR from a std::ostream
Previously I had asked how to write then read back IR to/from a file. The write code looked like: LLVMContext ctx; SMDiagnostic diag; Module *m = ParseIRFile( "my_file", diag, ctx ); However, the code I'm trying to retrofit LLVM IR into passes me just a std::ostream&. How can I read IR from a std::ostream? I figured out how to use raw_os_ostream to adapt a
2012 Oct 08
2
[LLVMdev] How can I find the LHS of the function call when traversing the function call
Hi All, I am a new member in the group, have been doing some experiments with LLVM IR. I am facing issue with de-compiling the following instruction once it is read, %var2 = call i8 @myfuncCall (i2 %var1) In after I parse the file (lets say using parseIRFiles ). I can see the instructions,( the function call instruction ), How can I get the %var2 from the instruction/callInstruction ? going thru the llvm installations cpp and .h files, it is not clear how do I get the desired variable. Thanks in Advance. regards Tarique -------------- next part -----...
2018 Dec 09
2
Parse LLVM IR
Hello, I am a newbie to LLVM and right now I am on the hook to parse some IR code and do some instrumentations. However, my problem is that no matter how I tweak my parsing code, it simply cannot print out anything. So here is my C code: int your_fun(int arg2) { int x = arg2; return x+2; } And here is my parsing code: #include <llvm/IR/Module.h> #include
2018 Feb 24
1
Parsing a bit code file
I am trying to parse LLVM IR from a bit code file. I went through the following steps. hello.cpp #include <iostream> int main() { std::cout << "Hello world!" << "\n"; return 0;} dump.cpp #include <llvm/IR/Module.h>#include <llvm/IRReader/IRReader.h>#include <llvm/IR/LLVMContext.h>#include <llvm/Support/SourceMgr.h> using
2019 May 17
3
Copy Function from one LLVM IR file to another
Hello everyone, I wanted to copy a function from one file to another. The file that I wanted to copy the function into contains a function with the same name and same number of instructions. I decided to just replace the instructions with those of the other function. I am doing all of this from within a function pass. *1.* I created a function pass in which I extract a function using
2010 Aug 19
1
[LLVMdev] questions about context
Hi, I am trying to load another bytecode file in one pass. I checked the opt.cpp, it uses following to load a bytecode file: ... LLVMContext &Context = getGlobalContext(); ... SMDiagnostic Err; // Load the input module... std::auto_ptr<Module> M; M.reset(ParseIRFile(InputFilename, Err, Context)); ... My question is in the runOnModule method where I want to load
2015 Jun 12
2
[LLVMdev] Register Allocation on IR
Hello all, I am trying to use the LLVM libraries to do register allocation on LLVM IR code -- and output IR as the result. There are two problems that arise when we try this : a. The LLVM backend requires that one goes through all the steps sequentially namely -- Instruction selection -- Scheduling and Formation -- SSA-based machine code optimizations -- Register
2013 Jul 29
2
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
I am hitting an LLVM assertion from the llc tool iff the bitcode file is optimized at -O3 level by opt). -O1 and -O2 levels of opt do not cause this assert. LLVM version 3.4svn DEBUG build with assertions. Built Jul 14 2013 (15:39:08). Default target: x86_64-unknown-linux-gnu Host CPU: amdfam10 I have attached the input bc file before -O3 optimization :bzip2.del.bc.tgz I have attached
2015 Mar 20
2
[LLVMdev] LLVM Exception Handling
Hi, I am trying to implement a scenario similar to running ExceptionDemo.cpp with parameter -1 (where the JITed code calls the C++ function which throws an exception) Different from the given example I am using IRParser instead of IRBuilder. I can successfully catch the exception in Linux but the program crashes in Mac and Windows. The code is similar to as follows: ### The test.cpp :
2013 Feb 15
0
[LLVMdev] Alternative to Linker::LinkInFile()
Looking at /tools/llvm-link/llvm-link.cpp may give you some ideas here. I havent looked at your specific use case, but llvm-link uses ParseIRFile to pull in a bitcode file and build a Module for it. You can then create a Composite using the Module * and call Linker::LinkModules(Composite.get(), NewModuleToLink.get()... to link a new Module to your Composite Module. -Chris On Feb 14, 2013, at
2016 Nov 20
3
uninitialized values in Attributes.cpp
I did a RelWithDebInfo + asserts build of LLVM just now and, when running "make check" under Valgrind, am seeing a lot of uses of uninitialized memory like the one below. Anyone know offhand what's likely to be the root cause? Unfortunately a Debug build doesn't give these errors. Thanks, John FAIL: LLVM :: Analysis/BasicAA/pr18573.ll (2093 of 18733)
2013 Aug 02
2
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
Hi Hal, I have filed http://llvm.org/bugs/show_bug.cgi?id=16780 -Milind On Fri, Aug 2, 2013 at 9:15 AM, Hal Finkel <hfinkel at anl.gov> wrote: > Milind, > > Have you filed a bug on this? If not, can you please open a bug report (http://llvm.org/bugs)? > > -Hal > > ----- Original Message ----- >> I am hitting an LLVM assertion from the llc tool iff the bitcode
2013 Feb 15
2
[LLVMdev] Alternative to Linker::LinkInFile()
On Thu, Feb 14, 2013 at 04:41:41PM -0800, Daniel Dunbar wrote: > Hi Tom, > > From the context I am assuming you are in a JIT context, so the comments > about using a platform specific LTO mechanism don't apply. > > Were you using this code to extract bitcode files from archives, or just to > link in an individual bitcode file? > Hi Daniel, I was using this code to
2013 Aug 02
0
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
Milind, Have you filed a bug on this? If not, can you please open a bug report (http://llvm.org/bugs)? -Hal ----- Original Message ----- > I am hitting an LLVM assertion from the llc tool iff the bitcode file > is optimized at -O3 level by opt). -O1 and -O2 levels of opt do not > cause this assert. > > LLVM version 3.4svn > DEBUG build with assertions. > Built Jul 14
2020 Sep 23
2
ORC JIT - Can modules independently managed with one LLJIT instance? + problems with ExecutionSession.lookup
Hi Lang, Thank you for your answer! This helped me again a lot!! Also that ResourceTracker is a really neat feature! Looking forward to it! :3 I changed the title cause… there is another issue I have (sorry about that…) I’m finally allowed to investigate the ORC JIT for integration into our system, which meant I got a few days to actually play around with it. However, another problem arise
2013 Aug 09
0
[LLVMdev] opt -O3 causes Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed
Hi, I don't see the LLVM bug I filed (http://llvm.org/bugs/show_bug.cgi?id=16780) making any progress. Can someone suggest me whether the bug is in the correct state? -Milind On Fri, Aug 2, 2013 at 1:29 PM, Milind Chabbi <Milind.Chabbi at rice.edu> wrote: > Hi Hal, > > I have filed http://llvm.org/bugs/show_bug.cgi?id=16780 > > -Milind > > On Fri, Aug 2, 2013 at
2012 Dec 27
1
[LLVMdev] Throwing an exception from JITed code, and catching in C++
Hi everyone, I am writing an application that uses LLVM JIT and I would like to throw an exception from the JIT and catch it in the C++ code that invokes the JIT. This does not seem to work. I've written what is hopefully a super simple demonstration to reproduce this. I would appreciate any help with this. Thank you The demonstration is composed of: 1) thrower.cpp - a source file that
2016 Nov 20
3
uninitialized values in Attributes.cpp
Well, it looks like almost all of the problems go away when I build using trunk instead of 3.9. So, that was scary but I'm going to forget it ever happened. >8000 test cases failed under Valgrind!! John On 11/20/2016 03:03 AM, Sanjoy Das via llvm-dev wrote: > Hi John, > > This is probably somewhat of a stretch, but since the problem does not > happen with a Debug build,