Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] how to dump a Instruction in gdb?"
2004 Apr 23
0
[LLVMdev] subtle problem with inst_iterator
On Fri, 23 Apr 2004, Vladimir Prus wrote:
> Yea, I've noticed that. However, it looks like inst_iterator is iterator over
> pointers. Oh, wait a minite, that's the current code:
>
> inline IIty operator*() const { return BI; }
> inline IIty operator->() const { return operator*(); }
>
> So operator* works as if value_type is Instruction*, but operator->
2011 Aug 29
0
[LLVMdev] insertions with inst_iterators?
On Aug 29, 2011, at 12:38 PM, ret val wrote:
> I am looping through all instructions in a Function and depending on
> what I found I may or may not insert code. Despite the fact that I'm
> only actually inserting *before* instruction I have a infinite loop
> when I do something like below. For awhile it was simple enough to
> just increment i enough times but now I need
2004 Apr 23
2
[LLVMdev] subtle problem with inst_iterator
Chris Lattner wrote:
> On Fri, 23 Apr 2004, Vladimir Prus wrote:
> > and since result of *it is considered to be rvalue it can't be accepted
> > by this operator. The complete discussion is in
> >
> > http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1385.htm
> >
> > I'd suggest to apply the following patch which makes operator* return
>
2011 Aug 29
4
[LLVMdev] insertions with inst_iterators?
I am looping through all instructions in a Function and depending on
what I found I may or may not insert code. Despite the fact that I'm
only actually inserting *before* instruction I have a infinite loop
when I do something like below. For awhile it was simple enough to
just increment i enough times but now I need something better.
for(inst_iterator i = inst_begin(F); i != inst_end(F); ++i)
2018 Aug 08
2
Error Calling eraseFromParent()
Hi. Thanks. I changed the code but the problem exists. This is my new code
which is again very simple:
...
bool runOnFunction(Function &F) override {
vector<Instruction *> dels;
dels.clear();
for (inst_iterator It = inst_begin(&F), Ie = inst_end(&F); It != Ie;) {
Instruction *I = &*(It++);
if (auto* op = dyn_cast<BinaryOperator>(I)) {
IRBuilder<NoFolder>
2011 Aug 23
2
[LLVMdev] write IR on file
hi
how can i write IRinstruction on a file.txt? when i use {for(inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I,count++) IRcodefile << std::basic_ostream(*I) <<"\n" } i get error.
is there any way that i can write it on file?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2013 Sep 24
2
[LLVMdev] get the address in memory where an instruction lives
Hi,
i want to get the address in memory of an instruction pointer and use it as
a key in my tables.
i iterate over the instructions in LLVM IR like this:
for (Module::iterator fi = Mod->begin(), fi_end = Mod->end(); fi != fi_end;
++fi) {
for (inst_iterator I = inst_begin(fi), E = inst_end(fi); I != E; ++I) {
Instruction *ii = dyn_cast<Instruction>(&*I);
2004 Apr 23
2
[LLVMdev] subtle problem with inst_iterator
Hello, I think there's a rather subtle problem with the inst_iterator. It
declares its iterator category as std::bidirectional_iterator_tag but C++
standard requirements for forward iterator (which are included in
requirements for bidirection iterator), say that the type of expression
*r;
should be T&, where 'r' is the iterator and T is its value type. The
inst_iterator,
2018 Aug 08
3
Error Calling eraseFromParent()
LLVM is built in Release mode. The version is 6.0.0. I think that a similar
code worked on verison 3.9.0. It is probably a null pointer dereference
occurring in eraseFromParent(). I checked and reconfirmed that the
instruction had no uses. Perhaps I should rebuild LLVM. Thanks.
On Wed, Aug 8, 2018 at 9:03 PM, mayuyu.io <admin at mayuyu.io> wrote:
> Hmmmm that’s strange. Do you get an
2010 Apr 21
2
[LLVMdev] How to delete a instruction?
I did a simple test just now, but I alse failed.
I delete several ordered instructions from end to begin,
but after deleting the first instruction(the last instruction of F), the
program crashed.
My test code is below (F is a function only containing several sequential
instructions):
for (inst_iterator inst == --inst_end(F); inst != inst_begin(F); --inst) {
Instruction * i = &*inst;
2016 Nov 28
2
LLVM Pass for Instructions in Function (error
Hi,
Sent via the Samsung Galaxy Note® 3, an AT&T 4G LTE smartphone
-------- Original message --------
From: Gurunath Kadam via llvm-dev <llvm-dev at lists.llvm.org>
Date: 11/27/2016 7:49 PM (GMT-06:00)
To: llvm-dev at lists.llvm.org
Subject: [llvm-dev] LLVM Pass for Instructions in Function (error
Hi,
Please find the embedded code. Also you may follow
2018 Aug 07
2
Error Calling eraseFromParent()
Thanks Bjorn! But The problem is still there.
On Wed, Aug 8, 2018 at 2:04 AM, Björn Pettersson A <
bjorn.a.pettersson at ericsson.com> wrote:
> It looks quite dangerous to erase the instruction I inside the loop when
> iterating over all instructions in the function.
> I guess it depends on how the range based iterator is implemented if that
> works or not.
>
> I think
2004 Apr 23
0
[LLVMdev] subtle problem with inst_iterator
On Fri, 23 Apr 2004, Vladimir Prus wrote:
> and since result of *it is considered to be rvalue it can't be accepted by
> this operator. The complete discussion is in
>
> http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1385.htm
>
> I'd suggest to apply the following patch which makes operator* return
> reference to pointer. It makes my code compile and the rest
2009 Jun 24
3
[LLVMdev] Replacing instruction in LLVM IR by an intrinsics
Hi everyone,
I am trying to write a pass, that finds some instructions and replaces them with my intrinsics,
but I am having problem understanding, how this should be done.
Let's say I have this instruction:
%tmp14 = load i32* getelementptr ([32 x i32]* @gpregs, i32 0, i64 28)
and i need to read the load's operands and replace it by let's say:
%tmp14 = call i32
2008 Apr 21
2
[LLVMdev] newbie question for type comparison
Hi,
I want to extract all instruction of the form "alloca %struct.S", where
$struct.S is defined as a struct
%struct.S = type { i32, i32 }
I'm using the following loop:
for(inst_iterator i = inst_begin(F), e = inst_end(F); i!= e; i++)
{
AllocaInst* ai;
if( (ai = dyn_cast<AllocaInst>(&*i))){
if(ai->getOperand(0)->getType()->getTypeID() ==
2011 May 07
1
[LLVMdev] def-use chain for Instruction
Hello all,
I am a LLVM newer who want to obtain the use-def chain for all instruction
of a sample code, for this purpose i use the following code.
///////////////sample code://///////////////////////
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define ARRAY_SIZE 5
int main() {
int x, y, holder;
int k,z,f,i;
z=0;
f=0;
k=0;
for(x = 0; x < ARRAY_SIZE;
2016 Nov 28
2
LLVM Pass for Instructions in Function (error
> On Nov 27, 2016, at 6:40 PM, Gurunath Kadam via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Hi Sandeep,
>
> Thanks.
>
> One question about:
>
> Value* AddrPointer = Inst->getIperand(0);
>
> So this works for LVALUE(S) i.e. in my case pointer on LHS of '='. I cannot find anything online about getloperand online.
>
> For reference
2009 Sep 06
3
[LLVMdev] Graphviz and LLVM-TV
On 2009-09-06 19:57, Ioannis Nousias wrote:
> Edwin,
>
> thank you for your effort, but I'm not sure I understand.
> Are you describing a graph traversal problem? Is the data model stored
> in a predecessor/successor fashion, which requires you to 'walk' the
> graph in order to visit all nodes? (and what happens when you have
> disjointed DFGs?).
Sorry for the
2009 Sep 06
2
[LLVMdev] Graphviz and LLVM-TV
On 2009-09-06 17:30, Ioannis Nousias wrote:
> I've tried to write a DFGPrinter based on the CFGPrinter, as you
> suggested, but encountered problems.
>
> The GraphWriter expects
> GraphTraits<GraphType>::nodes_begin()/nodes_end(). The way this is
> implemented in CFG.h, a function is a graph of basic blocks. A
> GraphTraits<Function*> inherits from
2004 Apr 27
2
[LLVMdev] subtle problem with inst_iterator
Chris Lattner wrote:
> > inline IIty operator*() const { return BI; }
> > inline IIty operator->() const { return operator*(); }
> >
> > So operator* works as if value_type is Instruction*, but operator-> works
> > as if value_type is Instruction. Hmm ;-)
>
> Yeah, fishy huh? :)
Yea, a bit. I've decided that before changing that I'd better