[LLVMdev] Enhancing TableGen

David A. Greene greened at obbligato.org
Thu Oct 6 12:36:34 PDT 2011

Jakob Stoklund Olesen <jolesen at apple.com> writes:

>> It's actually more complex than this but this gives the basic idea.
>> The key thing I need to be able to do is construct an instrinsic name
>> given some base string, a prefix and a suffix.
> David, I think the syntax you are proposing here is much better than
> the multidef syntax.

Yep, I agree.

> When I look at test/TableGen/MultiPat.td, I have a really hard time
> figuring out what is happening.

The multidef syntax is certainly esoteric and fixed by the for proposal.

I can see how the !foreach/!subst stuff could be daunting, but it is
really the key to writing completely generic patterns.  Maybe I can
replace !foreach with for.  I'll think about that.  I think it would
clean things up a lot.  !foreach has this odd iterator declaration mess
that for could potentially clean up.  Plus it wouldn't have such a nest
of functional lisp-like stuff.  :)

I really only need !foreach to do stuff like what's in MultiPat.td so if
I can do that with for, I'd be thrilled to completely dump !foreach.

>> Here's a critical question.  What type do the for loop iterators have?
>> string?
> That's probably good enough.

One thing I do like about multidef is that the user gets to declare the
iterator and its type.  Perhaps I'll try to do that with for.


More information about the llvm-dev mailing list