<div dir="ltr">Hi all,<div><br></div><div>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:</div><div><br></div><div>%a = getelementptr inbounds [100 x double], [100 x double]* %A, i32, 0, i64 0</div><div>%1 = load double, double* a, align</div><div><br></div><div>to:</div><div><br></div><div>%a = getelementptr inbounds [100 x double], [100 x double]* %A, i32, 0, i64 0</div><div>%splat.a = insertelement <2 x double*> undef, double* %a, i32 0</div><div>%brcst.a = shufflevector <2 x double*> % splat.a, <2 x double*> undef, <2 x i32>
zeroinitializer</div><div>%gep.addr = getelementptr <2 x double*> % brcst.a, <2 x i64> zeroinitializer <br></div><div>%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)<br></div><div><br></div><div>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:</div><div><br></div><div>PromoteIntegerOperand Op #2: 0x41bf3a8: v2f64,ch = masked_gather 0x415ec40, 0x41bf030, 0x41bf280, 0x41bbb30, 0x41becb8<LD16[%a]> [ORD=8] [ID=0]</div><div><br></div><div>Do not know how to promote this operator's operand!</div><div><br></div><div>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?</div><div><br></div><div>Best,</div><div>Zhi </div></div>