[LLVMdev] How to get more details from storeInst ?

Cheng Liu liucheng at eee.hku.hk
Thu Jan 17 18:00:22 PST 2013

I have a loop fully unrolled and got the following store instruction. 

store i32 %add.3, i32* getelementptr inbounds ([20 x [20 x i32]]* @c, i32 0,
i32 0, i32 0), align 4 

I want to know exactly which element of the array that is going to be
stored, which help me to transform the high level language to hardware. Take
the instruction above as an example, I know the data is stored into c[0][0].
It is just that I don't how to get c, 0, 0 from the instruction. 

At the moment, I use the method getNumOperands() and getOperand( int i) to
check all the operands of the instruction. However, I can only get two
operands. One of them is the data %add.s, and the other is the pointer. The
pointer has no name and it is not a constant. I couldn't move further into
the pointer to get the index of the element. 

Anyone could give me some suggestions on this?

View this message in context: http://llvm.1065342.n5.nabble.com/How-to-get-more-details-from-storeInst-tp53841.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.

More information about the llvm-dev mailing list