Displaying 20 results from an estimated 51 matches for "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 i...
2005 Jul 12
0
[LLVMdev] Getting started with LLVM Passes
...pecified by the
pointer values, etc..).
Would you suggest having LLVM add code after each instruction to get
this, or is there another way to do this? I've tried writing some
code, as follows (where i is an inst_iterator, but the results are
not what I would have expected:
for (User::op_iterator j = i->op_begin(), f = i->op_end(); j != f; +
+j) {
std::cerr << "Operand: " << (j->getUser())->getOperand(0) << "\n";
}
or
for (User::op_iterator j = i->op_begin(), f = i->op_end(); j != f; +
+j) {
std::cerr << "Opera...
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
...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 "use_iterator", but couldn't make it out. Is it a must to
write LLVM Pass to use op_iterator and use_iterator?
please give me any references or examples to understand more about
use_iterator.
Best Regards,
Srikanth Vaindam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120419/a5ee85ed/attachment.h...
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 in context: http://llvm.1065342.n5.nabble.com/get-the-identifies-of-the-unnamed-temporaries-from-the-instruction-of-LLVM-IR-tp56572.html
Sent from the LLV...
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
...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 "use_iterator", but couldn't make it out. Is it a must to
> write LLVM Pass to use op_iterator and use_iterator?
> please give me any references or examples to understand more about
> use_iterator.
>
>
> Best Regards,
> Srikanth Vaindam
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev...
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 out how to...
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
That's correct: the llvm::Instruction itself represents th...
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 Th...
2008 Jul 23
0
[LLVMdev] GEP::getIndexValid() with other iterators
...t Type *Ptr,
+ Value* const *Idx, unsigned NumIdx);
+
+ static const Type *getIndexedType(const Type *Ptr,
+ uint64_t const *Idx, unsigned NumIdx);
+
static const Type *getIndexedType(const Type *Ptr, Value *Idx);
inline op_iterator idx_begin() { return op_begin()+1; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080723/deee3d06/...
2004 Oct 12
1
[LLVMdev] Re: Hide visible string in variable (Chris Lattner)
...your suggestion, I got some progress. Thanks again. But I am still stuck in some problems.
Constant *Cstr = GV->getInitializer();
After that, I tried to use
a.
for(unsigned i=0;i<Cstr->getNumOperands();++i){
Cstr->getOperand(i);
}
b. for(User::op_iterator I=Cstr->op_begin(),E=Cstr->op_end(); I!=E;++I){
std::cerr<<*I;
}
From either a or b, I could get each element of Global Variable. Supposedly, I will use my arithmetic like XOR etc to encode/hide the string. But I cannot use XOR, I mean I tried (*I)^0x33, it...
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()<<"
]"<<v->getName()<<" T...
2015 Sep 13
3
RFC: faster simplifyInstructionsInBlock/SimplifyInstructions pass
...sInstructionTriviallyDead(I, nullptr)) {
// Loop over all of the values that the instruction uses. If there are
// instructions being used, add them to the worklist, because they might
// go dead after this one is removed.
SmallVector<Instruction *, 8> Operands;
for (User::op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI)
if (Instruction *Used = dyn_cast<Instruction>(*OI))
Operands.push_back(Used);
// Remove the instruction.
I->eraseFromParent();
// Only add the operands to the worklist if their uses are now empty,
//...
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