diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-12-21 23:26:20 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-12-21 23:26:20 +0000 |
commit | 36f7035bd7d0e99abfc362da20894388c2515605 (patch) | |
tree | a640aa3559a78de0475e100ec63089300a18ec06 /llvm/utils/TableGen/CodeGenDAGPatterns.h | |
parent | aa9fe53278677f6f80a4b05476da47d06bf1e584 (diff) | |
download | bcm5719-llvm-36f7035bd7d0e99abfc362da20894388c2515605.tar.gz bcm5719-llvm-36f7035bd7d0e99abfc362da20894388c2515605.zip |
[GlobalISel] Add basic Selector-emitter tblgen backend.
This adds a basic tablegen backend that analyzes the SelectionDAG
patterns to find simple ones that are eligible for GlobalISel-emission.
That's similar to FastISel, with one notable difference: we're not fed
ISD opcodes, so we need to map the SDNode operators to generic opcodes.
That's done using GINodeEquiv in TargetGlobalISel.td.
Otherwise, this is mostly boilerplate, and lots of filtering of any kind
of "complicated" pattern. On AArch64, this is sufficient to match G_ADD
up to s64 (to ADDWrr/ADDXrr) and G_BR (to B).
Differential Revision: https://reviews.llvm.org/D26878
llvm-svn: 290284
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.h')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h index d6107d98f32..97401cd8171 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.h +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h @@ -809,11 +809,13 @@ public: LessRecordByID>::const_iterator pf_iterator; pf_iterator pf_begin() const { return PatternFragments.begin(); } pf_iterator pf_end() const { return PatternFragments.end(); } + iterator_range<pf_iterator> ptfs() const { return PatternFragments; } // Patterns to match information. typedef std::vector<PatternToMatch>::const_iterator ptm_iterator; ptm_iterator ptm_begin() const { return PatternsToMatch.begin(); } ptm_iterator ptm_end() const { return PatternsToMatch.end(); } + iterator_range<ptm_iterator> ptms() const { return PatternsToMatch; } /// Parse the Pattern for an instruction, and insert the result in DAGInsts. typedef std::map<Record*, DAGInstruction, LessRecordByID> DAGInstMap; |