<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am trying to identify instructions which are array accesses in my source code.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
For example, something like:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span> for (int i = 1; i < 10; i++)<br>
</span>
<div>   {<br>
</div>
<div>       A[i] = 5;<br>
</div>
<div>       B[i] = A[i-1];<br>
</div>
<div>   }<br>
</div>
<span></span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
would be transformed to:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>  %1 = load i32, i32* %i, align 4<br>
</span>
<div><span style="color: rgb(200, 38, 19);">  store i32 5, i32* %arrayidx, align 4</span><br>
</div>
<div>  %2 = load i32, i32* %i, align 4<br>
</div>
<div>  <span style="color: rgb(200, 38, 19);">%3 = load i32, i32* %arrayidx2, align 4</span><br>
</div>
<div>  %4 = load i32, i32* %i, align 4<br>
</div>
<div><span style="color: rgb(200, 38, 19);">  store i32 %3, i32* %arrayidx4, align 4</span><br>
</div>
<span></span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Bodhi</div>
</body>
</html>