[PATCH] D44109: TableGen: Add a defset statement
Nicolai Hähnle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 5 12:20:36 PST 2018
nhaehnle created this revision.
nhaehnle added reviewers: arsenm, craig.topper, tra, MartinO.
Herald added a subscriber: wdng.
nhaehnle added a dependency: D44108: TableGen: Allow arbitrary list values as ranges of foreach.
nhaehnle added a dependent revision: D44110: TableGen: Add !dag function for construction.
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
Repository:
rL LLVM
https://reviews.llvm.org/D44109
Files:
docs/TableGen/LangRef.rst
include/llvm/TableGen/Record.h
lib/TableGen/TGLexer.cpp
lib/TableGen/TGLexer.h
lib/TableGen/TGParser.cpp
lib/TableGen/TGParser.h
test/TableGen/defset-typeerror.td
test/TableGen/defset.td
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44109.137057.patch
Type: text/x-patch
Size: 11465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180305/4a0d41b6/attachment.bin>
More information about the llvm-commits
mailing list