[LLVMdev] Extending LLVM

Chris Lattner sabre at nondot.org
Fri Mar 26 13:26:01 PST 2004


On Fri, 26 Mar 2004, Bill Wendling wrote:

> It is possible to extend LLVM to add, say, matrix operations at a higher
> level and then "lower" them into some version of LLVM "proper" after
> performing any transformations on them, right? Also, it's possible to
> have any custom-made types (like "matrix") as well?

It is certainly possible to do things like this.  I would recommend adding
a small set of intrinsic functions for the various operations that you
would like to support (matrix matrix multiply, etc), which your high-level
passes would easily recognize and be able to transform.  You would then
have a lowering pass that did the obvious expansion on them.

I don't think that you'd need to have an LLVM "matrix" type.  You should
be able to just use a two dimensional array, or opaque type, or
whatever.

-Chris

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




More information about the llvm-dev mailing list