Displaying 20 results from an estimated 8000 matches similar to: "[LLVMdev] llvm get Value* iterators"
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 Jan 11
2
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
Hi Duncan,
Thank you for your response! Now it works.
But I have another problem: Do you know how can I iterate through a Value*?
For instance, I have :
Instruction *I1; // I take only I1 that are ICmp
errs()<<"\n "<<*I1->getOperand(0)<<" \n";
// %3 = load i32* %c, align 4
As expected. Now I want to get %c from the previous to use "%c" in
2013 Jan 11
0
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
Alexandru Ionut Diaconescu <alexandruionutdiaconescu at gmail.com> writes:
> But I have another problem: Do you know how can I iterate through a Value*?
> For instance, I have :
>
> Instruction *I1; // I take only I1 that are ICmp
>
> errs()<<"\n "<<*I1->getOperand(0)<<" \n";
> // %3 = load i32* %c, align 4
>
> As expected.
2013 Jan 10
2
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
Hello everyone !
In my pass I inspect the penultimate instruction from every basic block in
runOnFunction(). I am interested in ICMP instructions only.
if(BB->size()>1)
if(last->getPrevNode())
{
previous = last->getPrevNode();
ok=1;
}
I want to get the operands of previous, which is of type Instruction*. Due
tests based on getNumOperands, ICMP has 2 (as
2013 Jan 10
0
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
Hi,
On 10/01/13 10:56, Alexandru Ionut Diaconescu wrote:
> Hello everyone !
>
> In my pass I inspect the penultimate instruction from every basic block in
> runOnFunction(). I am interested in ICMP instructions only.
>
> |if(BB->size()>1)
> if(last->getPrevNode())
> {
> previous = last->getPrevNode();
> ok=1;
> }
> |
2013 Jan 11
1
[LLVMdev] LLVM Instruction*->getOperand() not working properly for ICMP
Hi Óscar,
But if I do "I1->getOperand(0)->getOperand(0)" I get " ‘class llvm::Value’
has no member named ‘getOperand’ ". getOperand() I think it's only defined
for Instruction class. Do you know any equivalent method for Value?
On Fri, Jan 11, 2013 at 12:07 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:
> Alexandru Ionut Diaconescu
2013 Feb 27
3
[LLVMdev] llvm get annotations
Hello everyone !
I followed
http://stackoverflow.com/questions/4976298/modern-equivalent-of-llvm-annotationmanagerin
order to get annotations from my target bytecode. All the examples
that
I give in the following is related to the code from that link. I have
`__attribute__((annotate("DS"))) int f=0;` into the target C++ program and
the related IR code:
@.str = private unnamed_addr
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 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 May 28
2
[LLVMdev] unexpectedly loop hanging
Hi Alexandru, did you build LLVM with assertions enabled? If not then you
should do.
Ciao, Duncan.
2013 May 29
0
[LLVMdev] unexpectedly loop hanging
Hello Duncan,
Yes, I built it with assertions and I have also debug info.
On Tue, May 28, 2013 at 5:47 PM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Alexandru, did you build LLVM with assertions enabled? If not then you
> should do.
>
> Ciao, Duncan.
>
> ______________________________**_________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu
2013 Jan 28
5
[LLVMdev] Value* to Instruction*/LoadInst* casting
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 particular piece of code:
Value* V1 = icmpInstrArray[i]->getOperand(0);
Value* V2 = icmpInstrArray[i]->getOperand(1);
if (isa<LoadInst>(V1) || isa<LoadInst>(V2)){
...
2013 May 28
3
[LLVMdev] unexpectedly loop hanging
Hello everyone,
I was able to get all the execution paths between 2 points (basic blocks)
in my program (with the condition to traverse a loop only once). I mapped
all the basic blocks to integers and created a correspondent directed graph.
I was able to get all the paths (a path is represented by an integer
identifier). For my target program I have 72 paths, but the program hangs
unexpectedly
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 May 28
0
[LLVMdev] unexpectedly loop hanging
As an update, it is a memory problem which I don't know how to fix.
I tried to skip the problematic piece of code when in the case when the
loop hangs. So I did something like :
if( instr )
{
LLVMContext& C = instr->getContext();
Value* values[cnt];
errs()<<"\ngy: \n";
if(!(desters==7)){ // this
2013 Mar 04
2
[LLVMdev] llvm cannot iterate a [3 x i8]
Hello everyone,
I am trying to "parse" a part of LLVM IR. More exactly, from
@.str = private unnamed_addr constant [3 x i8] c"DS\00", section
"llvm.metadata"
I want to get "DS". It is the single place in the whole bytecode from where
I can get it. I have :
...
Value *VV = cast<Value>(LD100->getOperand(1)->getOperand(0));
2013 Jun 25
4
[LLVMdev] get value
Hi Cristianno,
Thank you, it works :)
with an extra cast:
Value *v ......
ConstantInt* RR = (ConstantInt *)v;
uint64_t VV = (RR->getValue()).getLimitedValue();
errs()<<"\nRR "<<VV<<"\n";
2013 Jan 28
1
[LLVMdev] Value* to Instruction*/LoadInst* casting
Hi Alexandru,
> 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
2013 Mar 05
5
[LLVMdev] LLVM load instruction query
HI,
I am creating a pass that will pass loaded value by load instruction to an
external function.
I don't know how to do it.Please Help.
2012 Dec 17
4
[LLVMdev] BasicBlock back()
Hello,
I am a beginner of LLVM. I am trying to move among the instructions of a
BasicBlock and I cannot. In this particular example, I try to get the
previous instruction of the end instruction. I am trying 2 methods:
1. I have the following sequence of code:
bool patternDC::runOnBasicBlock(BasicBlock &BB) {
...
if (BB.getTerminator())
{
Instruction* current =