[llvm-commits] [llvm] r137232 - in /llvm/trunk/utils/TableGen: Record.cpp Record.h TGParser.cpp

Chris Lattner clattner at apple.com
Wed Aug 10 14:03:58 PDT 2011


On Aug 10, 2011, at 12:48 PM, David A. Greene wrote:

> Chris Lattner <clattner at apple.com> writes:
> 
>>> Use an Init (ultimately a StringInit) to represent the Record name.
>>> This allows the name to be composed by standard TableGen operators.
>>> This will enable us to get rid of the ugly #NAME# hack processing and
>>> naturally replace it with operators.  It also increases flexibility
>>> and power of the TableGen language by allowing record identifiers to
>>> be computed dynamically.
>> 
>> Hi David,
>> 
>> This seems very strange.  Where are you going with this?
> 
> There are two things this can help address.
> 
> The first is changing the way #NAME# currently works.  That was
> something I added back a year or so ago to support AVX.

Sure, I know that you initially added it, but it is now used by a variety of other things.

> It's clunky and
> requires special processing in TGParser.  This change and some related
> ones I have coming can be used to replace #NAME# with strconcat
> operators.  Then the processing falls out natually from how operators
> work.

How is it clunky, why is this better?

> The second is additional flexibility that result from allowing Record
> names to be computed via operators.  It then becomes easy to add
> instruction mnemonic prefixes, suffixes, etc. programmatically, which
> allows the x86 SIMD .td file to be compressed dramatically.

Please give me an example of what this does to the .td files.

> With those code examples I think we can have a more productive
> conversation about what we have at Cray and have better understanding
> overall.  In other words, it's easier to talk about code than some
> abstract idea.  :)

Makes sense, but please give me a concrete example of what this enables (i.e. "before and after" .td snippets), not an abstract idea :)

-Chris



More information about the llvm-commits mailing list