<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt">Thank you, this is what I was looking for.<br><br>Alexandra<br><div><span><br></span></div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Hal Finkel <hfinkel@anl.gov><br> <b><span style="font-weight: bold;">To:</span></b> Jimborean Alexandra <xinfinity_a@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> llvmdev@cs.uiuc.edu <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, April 10, 2013 7:52 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [LLVMdev] How to call the llvm.prefetch intrinsic ?<br> </font> </div> <br>Alexandra,<br><br>I'm not
 sure what you mean by "replace", but I have code that does this to insert prefetches:<br><br>      Type *I8Ptr = Type::getInt8PtrTy((*I)->getContext(), PtrAddrSpace);<br>      Value *PrefPtrValue = ...<br><br>      IRBuilder<> Builder(MemI);<br>      Module *M = (*I)->getParent()->getParent();<br>      Type *I32 = Type::getInt32Ty((*I)->getContext());<br>      Value *PrefetchFunc = Intrinsic::getDeclaration(M, Intrinsic::prefetch);<br>      Builder.CreateCall4(PrefetchFunc, PrefPtrValue,<br>        ConstantInt::get(I32, MemI->mayReadFromMemory() ? 0 : 1),<br>        ConstantInt::get(I32, 3), ConstantInt::get(I32, 1));<br><br> -Hal<br><br>----- Original Message -----<br>> From: "Jimborean Alexandra" <<a ymailto="mailto:xinfinity_a@yahoo.com"
 href="mailto:xinfinity_a@yahoo.com">xinfinity_a@yahoo.com</a>><br>> To: <a ymailto="mailto:llvmdev@cs.uiuc.edu" href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><br>> Sent: Wednesday, April 10, 2013 12:43:23 PM<br>> Subject: [LLVMdev] How to call the llvm.prefetch intrinsic ?<br>> <br>> <br>> <br>> <br>> Hello,<br>> <br>> <br>> Can anyone please guide me how can I replace a load instruction with<br>> a prefetch. I was looking at the intrinsic creation methods of the<br>> IRBuilder, but I can only find functions corresponding to memset,<br>> memcpy and memmove intrinsics, not for prefetching.<br>> <br>> <br>> Also, I target x86-64 architectures. Is it sufficient to insert a<br>> call to the intrinsic in the LLVM IR to have the corresponding<br>> prefetch instruction generated for this target?<br>> <br>> <br>> <br>> Thank you for your help,<br>> Alexandra<br>> <br>>
 _______________________________________________<br>> LLVM Developers mailing list<br>> <a ymailto="mailto:LLVMdev@cs.uiuc.edu" 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><br><br> </div> </div>  </div></body></html>