<div dir="ltr"><div><div><div><div style="font-size:12.8000001907349px">What I want to do is to change the pInst from : 2%= load double* %1, align 8 to 2% = load < 2 x double>* %1, align 16, where <2 x double> should be two double identical double values that is same as the one in the previous instruction</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">Instruction* ScalarToVectorLoad(Instruction* pInst) {</div><div style="font-size:12.8000001907349px">  Value *loadValue = pInst->getOperand(0);</div><div style="font-size:12.8000001907349px">  Instruction *newLoad;   //this one should be 2% = load < 2 x double>* %1</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">  BitCastInst *scalarToVector = new BitCastInst(loadValue, VectorType::get(Type::getDoubleTy(currF->getContext()), 2), "vectorizedLoad", pInst);</div><div style="font-size:12.8000001907349px">  newLoad = new LoadInst(); //to be implemented...</div><div style="font-size:12.8000001907349px">  return newLoad;</div><div style="font-size:12.8000001907349px">}</div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 15, 2015 at 1:03 PM, mats petersson <span dir="ltr"><<a href="mailto:mats@planetcatfish.com" target="_blank">mats@planetcatfish.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Create a type that is a "vector (array) of 2 double", and then a<br>
pointer to that. Now use bitcast your on double pointer to that<br>
pointer type you've created, and then create a load...<br>
<br>
If you need more help, it would help if you post the code you are working on...<br>
<br>
--<br>
Mats<br>
<div><div class="h5"><br>
On 15 April 2015 at 19:51, zhi chen <<a href="mailto:zchenhn@gmail.com">zchenhn@gmail.com</a>> wrote:<br>
> How can I write code to generate IR for:<br>
> %2 = bitcast double* %1 to <2 x double>*.<br>
> %3 = load <2 x double>* %2, align 16<br>
> Basically, it is similar to x86 _mm_load_pd1 intrinsics.<br>
><br>
> Thanks,<br>
> Zhi<br>
><br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
</blockquote></div><br></div>