Allows capturing a list of concrete instantiated defs.
This can be combined with foreach to create parallel sets of def
instantiations with less repetition in the source. This purpose is
largely also served by multiclasses, but in some cases multiclasses
can't be used.
The motivating example for this change is having a large set of
intrinsics, which are generated from the IntrinsicsBackend.td file
included by Intrinsics.td, and a corresponding set of instruction
selection patterns, which are generated via the backend's .td files.
Multiclasses cannot be used to eliminate the redundancy in this case,
because a multiclass cannot span both LLVM's common .td files and
the backend .td files at the same time.
Change-Id: I879e35042dceea542a5e6776fad23c5e0e69e76b
Does it mean that instantiating any record that is not of type A will be an error? That sounds rather limiting.
That would prevent use of anonymous records or non-anonymous records or different types we may want to instantiate within the same multiclass hierarchy without having to duplicate all of it.
Could we change the semantics to the list collects all instantiated records of type A and, maybe, allow more than one pair of type:list , so we can collect multiple record types?
Another approach would be to say -- give me all records of type A, created by this defm instance. I.e. instead of defset A foo = { records } you do something like defm FOO : M<...>; list<A> foo = !defset(FOO).