[LLVMdev] scalar evolution to determine access functions in arays
Jimborean Alexandra
xinfinity_a at yahoo.com
Wed Jul 27 07:11:40 PDT 2011
Hello,
How can I compute the functions on the loop iterators used as array indices?
For example:
for i = 0, N
for j = 0, M
A[2*i + j - 10] = ...
Can I obtain that this instruction A[2*i + j - 10]= .. always accesses memory using a function f(i,j) = 2*i + j - 10 + base_address_of_A
If I run the scalar evolution pass on this code I obtain:
%arrayidx = getelementptr inbounds [200 x i32]* @main.A, i32 0, i64 %idxprom
--> ((4 * (sext i32 (-10 + (2 * %tmp6) + %tmp7) to i64)) + @main.A)
Could you please offer an insight on how can I obtain the function from the internals of the scalar evolution pass?
Thank you.
Alexandra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110727/32415f41/attachment.html>
More information about the llvm-dev
mailing list