[llvm-dev] error of using GATHER intrinsic

zhi chen via llvm-dev llvm-dev at lists.llvm.org
Mon Jan 18 11:28:03 PST 2016


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>


More information about the llvm-dev mailing list