[LLVMdev] Wish to extend the LLVM intermediate representation with prefetch support

Chris Lattner sabre at nondot.org
Fri May 28 11:37:04 PDT 2004


On Fri, 28 May 2004, Henrik Bach wrote:

> Hi LLVM Developers
>
> I would like to extend the LLVM intermediate representation with support for
> platform-independent prefetch support, if this project isn't assigned to
> someone.

That's great!  It is not yet taken, and it's a nice project.  Here are
some useful resources for you:

This should explain how to add an intrinsic function to llvm.  I recommend
naming it "llvm.prefetch":
http://llvm.cs.uiuc.edu/docs/ExtendingLLVM.html

To work on this project, I recommend working from the current CVS sources,
to make it easier to merge your work back in when you are done with it.
You can get information on how to grab CVS here (***):
http://llvm.org/docs/GettingStarted.html

For prefetching in particular, I would recommend looking at the GCC
prefetch intrinsic that they have.  There did a lot of work to come up
with a clean and generic interface to prefetching.  We should probably
shamelessly borrow their interface:
http://gcc.gnu.org/projects/prefetch.html

I would recommend adding prefetch support to one of the backends, for
example the X86 backend.  To see how intrinsics are handled by the code
generators, search for Intrinsic::memcpy in
lib/Target/X86/InstSelectSimple.cpp.


As always, if you have any questions, please let us know!


*** Our department is currently blocking CVS access due to a remote root
exploit recently discovered.  This will hopefully be resolved soon though.

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list