[LLVMdev] compare two GEP instructions operand by operand

Jimborean Alexandra xinfinity_a at yahoo.com
Tue Aug 30 08:10:28 PDT 2011


Hi,

I have a question regarding the GEP instruction. Is 
it correct to consider that two GEP instructions compute the same memory address if and only if all their corresponding fields are equal? 


For instance, for a two-dimensional array of integers, can we have two GEP instructions that are equal? 


  %arrayidx = getelementptr [10 x [30 x i32]]* @main.B, i64 0, i64 0, i64 %tmp157

  %tmp = load i32* getelementptr inbounds ([10 x [30 x i32]]* @main.B, i64 0, i64 3, i64 10), align 8

although their corresponding indices are different? For instance if %tmp157 goes out of the bounds of the line 0 and computes the address of the 10th 
element in line 3.


Thank you,Alexandra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110830/a964c954/attachment.html>


More information about the llvm-dev mailing list