[LLVMdev] tblgen multiclasses

Roman Levenstein romixlev at yahoo.com
Mon Oct 9 01:33:11 PDT 2006

Hi Chris,

Thanks for this info. This provides even better and more advanced
examples of multiclass usage! 

But your previous explanations were so good that I implemented in my
backend last week almost the same that you've done now in the
X86InstrSSE.td. I even introduced isCommutable parameter to indicate
this property, just as you did. So, by now integer arithmetic and
general purpose instructions are implemented. I'm working on the FP
support now.

Some feedback about tblgen from my side, i.e. an LLVM newcomer with
quite some compiler construction experience: 
When it comes to tblgen descriptions and corresponding DAG selection
and lowering code to be written for a backend, I found the use of
InFlag, OutFlag and chains less understandable, very underspecified and
not (well ) documented. Even though they are used in all backends,
their semantics and correct use is far from obvious (even though I'm
not new to compiler writing). I spent most time on getting these things
right. And I learned that if they misbehave it has very fatal
consequences on the overall code selection process. Now it works, but I
still don't quite understand their overall semantics and don't feel
very confident about them. And I guess I'm not the only one. Therefore,
I would kindly ask to provide here on the developers list and may be
even in the docs a clear explanation of these concepts, giving
guidelines on their usage and probably a small, but understandable
example making use of them. I think such a description would make
creation of new backends much  easier and faster.

Best Regards,

--- Chris Lattner <sabre at nondot.org> wrote:

> For anyone interested, X86InstrSSE.td makes extensive use of
> multiclasses 
> now if people are looking for examples other than the sparc backend.
> -Chris
> -- 
> http://nondot.org/sabre/
> http://llvm.org/
> _______________________________________________

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the llvm-dev mailing list