Hi all, I am using gather intrinsic to load a value from the same address twice at the same time. Basically, I used my own pass to changed the following bitcode: %a = getelementptr inbounds [100 x double], [100 x double]* %A, i32, 0, i64 0 %1 = load double, double* a, align to: %a = getelementptr inbounds [100 x double], [100 x double]* %A, i32, 0, i64 0 %splat.a = insertelement <2 x double*> undef, double* %a, i32 0 %brcst.a = shufflevector <2 x double*> % splat.a, <2 x double*> undef, <2 x i32> zeroinitializer %gep.addr = getelementptr <2 x double*> % brcst.a, <2 x i64> zeroinitializer %1_gather = call <2 x double> @llvm.masked.gather.v8f64(<2 x double*> %gep.addr, i32 8, <2 x i1> <i1 true, i1, true>, <2 x double> undef) I could load my pass successfully with opt, but I got the following errors when I either run the new bitcode using lli or generate the assembly using llc: PromoteIntegerOperand Op #2: 0x41bf3a8: v2f64,ch = masked_gather 0x415ec40, 0x41bf030, 0x41bf280, 0x41bbb30, 0x41becb8<LD16[%a]> [ORD=8] [ID=0] Do not know how to promote this operator's operand! Any idea about this error? Or could anyone give me an example how to use the gather intrinsic if there is something wrong with the way I am using it? Best, Zhi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160118/d508fbf2/attachment.html>
Tim Northover via llvm-dev
2016-Jan-20 20:59 UTC
[llvm-dev] error of using GATHER intrinsic
Hi Zhi, On 18 January 2016 at 11:28, zhi chen via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Any idea about this error? Or could anyone give me an example how to use the > gather intrinsic if there is something wrong with the way I am using it?Modulo obvious typos, the snippets look like they ought to work (on trunk at least). Do you have an actual .ll or .bc and llc invocation that fails? Cheers. Tim.
> On Jan 20, 2016, at 12:59 PM, Tim Northover via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi Zhi, > > On 18 January 2016 at 11:28, zhi chen via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> Any idea about this error? Or could anyone give me an example how to use the >> gather intrinsic if there is something wrong with the way I am using it? > > Modulo obvious typos, the snippets look like they ought to work (on > trunk at least). Do you have an actual .ll or .bc and llc invocation > that fails?Only typo that caught my eye is ‘llvm.masked.gather.v8f64’ which should have v2 instead of v8 to match the <2 x double> Could that be the problem? Cheers, Pete> > Cheers. > > Tim. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Hi Tim, Thanks for your response. It works now if I use llc -mcpu=skylake. But it still fails if I use -mcpu=core-avx2. It seems that avx2 supports gather/scatter, but I am not sure why it doesn't work. Best, Zhi On Wed, Jan 20, 2016 at 12:59 PM, Tim Northover <t.p.northover at gmail.com> wrote:> Hi Zhi, > > On 18 January 2016 at 11:28, zhi chen via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Any idea about this error? Or could anyone give me an example how to use > the > > gather intrinsic if there is something wrong with the way I am using it? > > Modulo obvious typos, the snippets look like they ought to work (on > trunk at least). Do you have an actual .ll or .bc and llc invocation > that fails? > > Cheers. > > Tim. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160120/99c6212e/attachment.html>