Chatterjee, Bodhisatwa via llvm-dev
2019-Sep-16 05:23 UTC
[llvm-dev] Identify Array Accesses from LLVM's IR
Hi,
I am trying to identify instructions which are array accesses in my source code.
For example, something like:
for (int i = 1; i < 10; i++)
{
A[i] = 5;
B[i] = A[i-1];
}
would be transformed to:
%1 = load i32, i32* %i, align 4
store i32 5, i32* %arrayidx, align 4
%2 = load i32, i32* %i, align 4
%3 = load i32, i32* %arrayidx2, align 4
%4 = load i32, i32* %i, align 4
store i32 %3, i32* %arrayidx4, align 4
Is it possible for me to somehow separate out the part of IRs which have
'arrayidx's which would allow me to identify array accesses in my source
code?
Thanks,
Bodhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20190916/52c837f2/attachment.html>