[LLVMdev] Not Understanding Use

bdavis at cs.fsu.edu bdavis at cs.fsu.edu
Mon Feb 6 16:22:24 PST 2012

Let's say I have the following IR code:

21> %tmp = load i32* @myrand.z, align 4
22> %tmp1 = and i32 %tmp, 5535
23> %tmp2 = mul nsw i32 %tmp1, 36969
24> %tmp3 = ashr i32 %tmp, 16

And I have an Instruction *inst that is the instruction on line 22.

then have the code:

Use *operand1 = &(inst->getOperandUse(0));

I expect that operand1->getNext() will return the the Use* for %tmp in  
the instruction on line 24. However, what I get is a null pointer. Why  
is this exactly? I feel I'm not understanding the point of the Use if  
I can't even see the very next usage only 2 instructions away.

So I must be missing something.

Thank you.

This message was sent using IMP, the Internet Messaging Program.

More information about the llvm-dev mailing list