[llvm-dev] load instruction to gather intrinsics

陳韋任 via llvm-dev llvm-dev at lists.llvm.org
Fri May 5 16:10:12 PDT 2017


2017-05-06 5:42 GMT+08:00 zhi chen via llvm-dev <llvm-dev at lists.llvm.org>:

> Hi All,
>
> 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
>
> %1 = load <2 x i64>* %arrayidx1, align 8
>
> to
>
> %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)
>
>
​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.



> Basically, I am not sure how to get two consecutive addresses started from
> arrayidx1. Thanks for your time and help in advance.
>

​Maybe `getelementptr` is what you need to calculate consecutive addresses.

​[1] http://llvm.org/docs/LangRef.html#llvm-masked-gather-intrinsics​

​HTH,
chenwj​

-- 
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170506/c8436b5d/attachment.html>


More information about the llvm-dev mailing list