<div dir="ltr">But I think I still need to get A+i and A+i+1 from <span style="color:rgb(0,0,0);font-size:12.8px;white-space:pre-wrap">%1 = load <2 x i64>* %Ai, align 8 even if I want to use getelementptr, is that correct?</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 5, 2017 at 4:56 PM, 陳韋任 <span dir="ltr"><<a href="mailto:chenwj.cs97g@g2.nctu.edu.tw" target="_blank">chenwj.cs97g@g2.nctu.edu.tw</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><span class=""><br><div class="gmail_quote">2017-05-06 7:41 GMT+08:00 zhi chen <span dir="ltr"><<a href="mailto:zchenhn@gmail.com" target="_blank">zchenhn@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The frontend would generate the load in the IR. I am using IRBuilder to generate gather. I know it is mainly for discontinuous memory locations. It's a long story why I want to use this. I want to gather some memory locations. Suppose there are an array A, I manually duplicated it somewhere with an offset x. Now, we have two arrays A and A', where A'[i] - A[i] = offset. I want to gather the two values at A+i and A+i whenever there was a load instruction to get a value from A+i. <div><br></div><div>It is easy to do this if the code was not vectorized, but it become tricky when they are vectorized. If there is a load <span style="color:rgb(0,0,0);white-space:pre-wrap">%1 = load <2 x i64>* %Ai, align 8, which loads two consecutive values at Ai, I need to gather the values from A'i as well. So I think I need to use gather to get values from A+i, A+i+1, A'+i, A'+i+1. </span>  </div></div></blockquote></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​</div></span><div class="gmail_default"><span style="font-family:arial,helvetica,sans-serif">I think you can use <span style="font-size:14px">`getelementptr`</span><span style="font-size:14px"> to calculate </span>​</span><font color="#000000"><span style="white-space:pre-wrap">the address needed by the </span></font><span style="font-family:arial,helvetica,sans-serif;font-size:14px">gather intrinsic, though I don't know</span></div><div class="gmail_default"><span style="font-family:arial,helvetica,sans-serif;font-size:14px">if there is better way to achieve your goal.</span></div><span class=""><div><br></div>-- <br><div class="m_8560306531607639148gmail_signature"><div dir="ltr"><div>Wei-Ren Chen (陳韋任)<br>Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/<wbr>~chenwj</a></div></div></div>
</span></div></div>
</blockquote></div><br></div>