search for: op_iterators

Displaying 20 results from an estimated 51 matches for "op_iterators".

Did you mean: op_iterator
2008 Mar 12
3
[LLVMdev] Question about use-def chain
Programmers’ manual says we can iterate over a use-def chain by op_iterator. It works fine except for load and store instruction of stack variables. For example, a simple bitcode is like the below. i = alloca i32 store i32 0, i32* %i, align 4 %tmp1 = load i32* %i, align 4 If I apply a use-def chain to load instruction, I get alloca instruction. I think store instruction is a correct
2005 Jul 12
0
[LLVMdev] Getting started with LLVM Passes
Chris, I've now figured out how to track and single out specific instructions, which was ridiculously easy. Thanks! I'm now on to trying to find more detail about those instructions, such as the values and addresses of the operands in memory (or, in the case of operands which are pointers, trying to get the pointer values, addresses, and values stored at location specified by
2007 Jul 10
1
[LLVMdev] API design (and Boost and tr1)
...#39;m not sure I'm ready to go > and change everything to CallInst factories given the tons of other things > I've got to work on. Of course :) > The iterator and one-argument constructors appear to cover 99% of the > cases and the two-argument clients can often just pass Use::op_iterators > directly. I've even found one case where we can eliminate a temporary vector. nice! -Chris -- http://nondot.org/sabre/ http://llvm.org/
2012 Apr 19
3
[LLVMdev] def-use chains and use-def chains
Hi, I need to find out all the places where the value of a variable is being used. For this I have to implement reaching definitions(def-use chains). When I searched for its implementation I found Iterating over def-use & use-def chains <http://llvm.org/docs/ProgrammersManual.html#iterate_chains>. will this work for finding the places where a variable is reaching? I tried to use
2005 Jul 11
2
[LLVMdev] Getting started with LLVM Passes
... here is some generally useful information I should have cc'd to llvmdev in the first place ... -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/ ---------- Forwarded message ---------- Date: Sun, 10 Jul 2005 21:41:55 -0500 (CDT) From: Chris Lattner <sabre at nondot.org> To: Sean Peisert <peisert at gmail.com> Subject: Re: [LLVMdev] Getting started with LLVM
2012 May 09
4
[LLVMdev] How can I get the destination operand of an instruction?
I am able to access the source operands of an instruction using either getOperand() or op_iterator, However, I can't find any method available for destination operand. Someone suggests that instruction itself can represent the destination operand. http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-January/037518.html The getOperand() returns an unsigned value like 0x9063498, while I can't
2013 Apr 09
2
[LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
hello guys: I am in trouble with get the identifies of the unnamed temporaries from the instruction of LLVM IR. for example: instruction: %4 = mul nsw i32 %1, %width unnamed temporaries: %4, %1 how to get them? I have tried several iterators(op_iterator,value_op_iterator) and getOperand(int) function,but none of them works. does anyone know how to get it? thanks very much -- View this message
2007 Jul 05
0
[LLVMdev] API design (and Boost and tr1)
...ve got working and checked in. I'm not sure I'm ready to go and change everything to CallInst factories given the tons of other things I've got to work on. The iterator and one-argument constructors appear to cover 99% of the cases and the two-argument clients can often just pass Use::op_iterators directly. I've even found one case where we can eliminate a temporary vector. -Dave
2012 Apr 20
0
[LLVMdev] def-use chains and use-def chains
Hi Duncan Sands, I frankly don't know what a variable gets converted to (SSA register or memory chunk). What I meant is, for example I1: int i, j=10; I2: scanf("%d", &j); I3: i = j + 1; Here I want to know whether the value of j in I1 reaches I3 or not. Best Regards, Srikanth Vaindam you didn't define what you mean by a variable. LLVM has virtual registers which are
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
Hi Nick, I parsed your message again carefully and did some experiments. I guess the: for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i) { } iterates over the operands of the instruction "I", which are as you said, *other* instructions. But if I want to get other information about the instruction, say the type of the operands, then I still need to figure
2009 Sep 28
4
[LLVMdev] Printing Function Arguments
ivtm wrote: > Hey Oscar, > > I want to extract information from the instruction. > > Think writing a simple interpreter. > > I already have the CallInst instance (described above in the message). > > Via ci->getOperand(1) say I can get the 'i32 8' parameter and I can get the > 'i32' and '8' separately as Nick described. > > But I
2012 May 09
0
[LLVMdev] How can I get the destination operand of an instruction?
Launcher <st.liucheng at gmail.com> writes: > I am able to access the source operands of an instruction using either > getOperand() or op_iterator, However, I can't find any method available for > destination operand. Someone suggests that instruction itself can represent > the destination operand. > http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-January/037518.html
2007 Jul 05
4
[LLVMdev] API design (and Boost and tr1)
On Thu, 5 Jul 2007, David Greene wrote: >>> We should just keep the existing constructor, so this isn't a problem. >>> These clients don't have the "dereference end" problem. >> >> Duh. >> >> Yep, ok, this sounds good. > > Grr. That's no so easy either, because it conflicts with the one-argument > specialized constructor.
2012 Jun 21
0
[LLVMdev] Cloning block for newbie
...l has examples of how to iterate over many common structures, such as instructions in a basic block[1]. Other than that, you can check the source code or doxygen[2]. Basically, you loop over the instructions as detailed in the programmer's manual[1], and loop over the operands using User's op_iterators[2] checking to see if they have entries in ValueMap[3]. If they do, you set that operand to use ValueMap's entry. [1] http://llvm.org/docs/ProgrammersManual.html#iterate_basicblock [2] http://llvm.org/doxygen/classllvm_1_1User.html [3] http://llvm.org/doxygen/classllvm_1_1ValueMap.html On Thu...
2008 Jul 23
0
[LLVMdev] GEP::getIndexValid() with other iterators
Hi Chris, > What flavor of iterators do you want to pass in? vector or > smallvector? If so, a pointer to the first element + extents is fine. I was passing a std::vector in. And you are quite right, first element + size works like a charm. Since I am using a vector of uint64_t's instead of Value*, I did need to add an extra version of getIndexedType(), taking a uint64_t* instead
2004 Oct 12
1
[LLVMdev] Re: Hide visible string in variable (Chris Lattner)
Hi, Thanks so much at first. > Here are some observations: > > > for C level, > > > > char a[]="global string test"; > > for(i=0;i<strlen(a);i++){ > > a[i]= a[i]^RANDMON; > > } > > If you compile this C code, "global string test" will occur in the program > binary, so you have not obfuscated anything. You can
2008 Jul 23
2
[LLVMdev] GEP::getIndexValid() with other iterators
On Jul 22, 2008, at 11:54 PM, Matthijs Kooijman wrote: > Hi Chris, > > >> I'd prefer to not turn this into a template. Why not just define a >> version that takes an array of uint64_t's or something like that? > because I want to be able to pass in iterators. I could define a > version that > takes std<uint64_t>::iterators, but next thing we know, we
2006 Mar 03
1
[LLVMdev] printing constants
Sir, I am using the op_begin and op_end iterator for iterating over the operands as mentioned below. for (User::op_iterator operand=j->op_begin(),operand_end=j->op_end();operand!=operand_end;++operand){ Value *v=operand->get(); const Type *t=v->getType(); cerr<<endl<<" operand: "<<"[ "<<v->hasName()<<"
2015 Sep 13
3
RFC: faster simplifyInstructionsInBlock/SimplifyInstructions pass
LLVM has two similar bits of infrastructure: a simplifyInstructionsInBlock function and a SimplifyInstructions pass, both intended to be lightweight “fix up this code without doing serious optimizations” functions, as far as I can tell. I don’t think either is used in a performance-sensitive place in-tree; the former is mostly called in minor places when doing CFG twiddling, and the latter seems
2012 Jun 21
3
[LLVMdev] Cloning block for newbie
Hello everybody. I'm quite new to LLVM and I'm encontering problems with cloning basic blocks. My two basic blocks are in the same function and it doesn't really matter how the cloned one behave for the moment. Of course, to do so, I used the cloning.h 's method "CloneBasicBlock" but I have the "Instruction does not dominate all uses!" error. I know what it