similar to: [LLVMdev] write a transformation pass

Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] write a transformation pass"

2012 Dec 20
1
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
I solved by checking if(BB->size()>1) Thank you all for the help ! Now debugging the next segfault. On Thu, Dec 20, 2012 at 12:59 PM, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > getPrevNode<http://llvm.org/docs/doxygen/html/classllvm_1_1ilist__node.html#a77b897207ef0a1ae95c404695aed9a4b>() > Get the previous node, or 0 for the list
2013 May 02
0
[LLVMdev] int to StringRed conversion
Yes, it sounds good. I can try tomorrow. Thank you for your advice ! On Thu, May 2, 2013 at 5:43 PM, Logan Chien <tzuhsiang.chien at gmail.com>wrote: > I think the better solution should be: > > > LLVMContext& C = is->getContext(); > Value *values[] = { > ConstantInt::getSigned(Type::getInt64Ty(C), *scsr*), > MDString::get(C, *"path"*) > };
2013 Jun 07
1
[LLVMdev] CFG of a function
But I don't want to map only basic blocks, I need too to map the edges "the whole CFG of the function" Save the CFG of the function in another memory address and call it for example orgCFG and change the CFG by referencing to the orgCFG Thank you for help and patience On 6 June 2013 10:59, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > I
2013 Jun 06
0
[LLVMdev] CFG of a function
I don't use a function for do the mapping, it may be MapValue(). If it does not work, alias an int identifier for each basic block. Be aware because basic block cannot have the same name (getName) in the same function, but they might have the same name being in different functions. Therefore, take into account the function name as well. Good luck On Thu, Jun 6, 2013 at 10:55 AM, Rasha Omar
2013 Mar 01
1
[LLVMdev] llvm get annotations
Hi, I solved it. From the ConstantStruct you can call getOperand() multiple times, so "mine" as deep as you can. On Fri, Mar 1, 2013 at 1:41 PM, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > > Hi Sebastian, > > Thanks for the response. > > I already did this : > > I cast the entire annotated expression to Value*. Then, in
2013 May 02
2
[LLVMdev] int to StringRed conversion
I think the better solution should be: LLVMContext& C = is->getContext(); Value *values[] = { ConstantInt::getSigned(Type::getInt64Ty(C), *scsr*), MDString::get(C, *"path"*) }; lnstr.setMetadata(*"your_analysis_name"*, MDNode::get(C, values)); So that you can take advantage of the type system of LLVM bitcode, and don't have to cast the integers from/to strings
2013 May 02
0
[LLVMdev] int to StringRed conversion
The problem is that I want to pass only srsr which is an int. "marked" was just an example :) Thanks you! On Thu, May 2, 2013 at 5:06 PM, Logan Chien <tzuhsiang.chien at gmail.com>wrote: > I'm not familiar with this, but maybe you can try: > > StringRef tst = ("marked" + Twine(srsr)).str(); > > It seems that you can't use integer as meta data
2013 Mar 05
0
[LLVMdev] LLVM load instruction query
Try : INITIALIZE a1 if you didnt. if (cpProf EXISTS){ CallInst* newInst = CallInst::Create(cpProf,a1,""); if (BB->getTerminator() && CI) BB->getInstList().insert((Instruction*)CI, newInst); On Tue, Mar 5, 2013 at 1:04 PM, Anshul Garg <gargaa24 at gmail.com> wrote: > CallInst* newInst = CallInst::Create(cpProf,a1,""); >
2012 Dec 20
0
[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*
getPrevNode<http://llvm.org/docs/doxygen/html/classllvm_1_1ilist__node.html#a77b897207ef0a1ae95c404695aed9a4b>() Get the previous node, or 0 for the list head. I don't see any method like hasPrevNode. It can be a weird problem because "current->getPrevNode()" is indicating to "current" itself (the problem appears for the BB with only one element)? On Thu, Dec
2013 Mar 01
0
[LLVMdev] llvm get annotations
Hi Sebastian, Thanks for the response. I already did this : I cast the entire annotated expression to Value*. Then, in order to avoid ugly things like getAsString(), I check if V->getValueID() == Value::ConstantArrayVal in order to cast it to ConstantArray. Because it contains only array[0], I cast array0>getOperand(0) to ConstantStruct. Therefore, from ConstantStruct you can get all the
2013 Jun 06
0
[LLVMdev] CFG of a function
Map every basic block from the CFG to a set of integers. The successors from the CFG can be used to make the edges in your simplified graph. The pair (Callee,Caller) can link the CFG-s between them in a larger CFG-like. On Wed, Jun 5, 2013 at 11:03 PM, Rasha Omar <rasha.sala7 at gmail.com> wrote: > What do you mean by mapping to integers? > > > On 5 June 2013 22:32, Alexandru
2013 Jun 10
0
[LLVMdev] CFG of a function
Hi Rasha, First, you should not erase that cloned function XD the idea is that your pass should create that new function, add it to a module (that could be the same one where the original function is, or another one that you could be creating if that is the case), and then just let it be: the pass manager should identify this new function (after your pass returned) and all the other analysis and
2013 Jun 05
2
[LLVMdev] CFG of a function
What do you mean by mapping to integers? On 5 June 2013 22:32, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > Why you don't map the basic blocks to integers and apply algorithms on the > integer graph? And construct your new CFG. > > > On Wed, Jun 5, 2013 at 10:27 PM, Rasha Omar <rasha.sala7 at gmail.com> wrote: > >> How
2013 Feb 27
0
[LLVMdev] llvm get globals definition line number
However, I do have: !924 = metadata !{i32 786484, i32 0, null, metadata !"r", metadata !"r", metadata !"", metadata !841, i32 19, metadata !56, i32 0, i32 1, i32* @r} ; [ DW_TAG_variable ] [r] [line 19] [def] with on which `!0` is indirectly dependent and there is `!llvm.dbg.cu = !{!0}` . On Wed, Feb 27, 2013 at 11:35 AM, Alexandru Ionut Diaconescu <
2013 Jun 06
3
[LLVMdev] CFG of a function
I think I understood that, but what I mean is what is the function responsible to do mapping is it MapValue() in ValueMapper.h? Thanks for your help On 6 June 2013 09:54, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > Map every basic block from the CFG to a set of integers. The successors > from the CFG can be used to make the edges in your simplified
2013 Mar 05
0
[LLVMdev] LLVM load instruction query
Ok, so there is a general segfault. You can use a tool for detecting seg fault, but better try to use the "return false" statement in your pass. I assume you have your code into runOnFunction or runOnModule. So check with return false where the program crashes. identify the statement that is causing the segfault. The most common segfaults in LLVM are due 1. reference a NULL pointer...put
2013 May 28
1
[LLVMdev] unexpectedly loop hanging
Hi, I don't know much about this issue, but this malloc error won't be solved by a change to delete[] or free. In fact, if you use the incorrect one for simple types, you may not notice it. The error you have seems to me like a memory corruption because you went out of bound and corrupted the memory somewhere, Valgrind may help you figure out what is going on. Cheers, Matthieu
2013 Jan 28
0
[LLVMdev] Value* to Instruction*/LoadInst* casting
The compilation error is : `error: ‘LD100’ was not declared in this scope.` On Mon, Jan 28, 2013 at 11:31 AM, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > Hello everyone, > > Can you please tell me if it is possible in LLVM to cast a `Value*` to an > `Instruction*/LoadInst*` if for example `isa<LoadInst>(MyValue)` is true? > In my
2013 Jan 11
0
[LLVMdev] llvm get Value* iterators
If I1->getOperand(0) is the load, then %c is its pointer argument available with: LoadInst *LD = cast<LoadInst>(I1->getOperand(0)); Value *C = LD->getPointerOperand(); On Fri, Jan 11, 2013 at 7:19 AM, Alexandru Ionut Diaconescu < alexandruionutdiaconescu at gmail.com> wrote: > Hello everyone ! > > In my LLVM pass, there is `Intruction* I1`. All the used
2013 Mar 15
0
[LLVMdev] write a simple MachineFunctionPass
I found that : "Code generator passes are registered and initialized specially by TargetMachine::addPassesToEmitFile and similar routines, so they cannot generally be run from the *opt* or *bugpoint* commands."...So how I can run a MachineFunctionPass? In the end, I just want to apply a DFS on a CFG of a function. And I need oriented edges and wanted to use