<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-05-06 5:42 GMT+08:00 zhi chen via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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">Hi All,<div><br></div><div>Can I change a vector load to gather intrinsic? If so, how can I do it? For example, I want to change the following IR code</div><div><br></div><div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">%1 = load <2 x i64>* %arrayidx1, align 8</pre></div><div>to</div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">%1 = call <2 x i64> @llvm.masked.gather.v2i64(<2 x i64*> %arrayidx1, i32 8, <2 x i1> <i1 true, i1 true>, <2 x i64> undef)</pre></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​How those IR would be generated? By frontend or your IRBuilder?​ And why you want to use gather intrinsic? From the LangRef [1], seems it is mainly for discontinuous memory locations. </div><div><br></div><div> </div><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"><div></div><div>Basically, I am not sure how to get two consecutive addresses started from arrayidx1. Thanks for your time and help in advance.</div></div></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​Maybe `getelementptr` is what you need to calculate <span style="font-family:arial,sans-serif">consecutive addresses.</span></div>







</div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​[1] <a href="http://llvm.org/docs/LangRef.html#llvm-masked-gather-intrinsics">http://llvm.org/docs/LangRef.html#llvm-masked-gather-intrinsics</a>​</div><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​HTH,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">chenwj​</div><br></div>-- <br><div class="gmail_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/~chenwj</a></div></div></div>
</div></div>