diff options
author | Chris Lattner <sabre@nondot.org> | 2006-11-04 05:12:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-11-04 05:12:02 +0000 |
commit | efe9f4a3b69eb2a31f006476996c8ef722345193 (patch) | |
tree | 7db59775b2f7f0477e72914488efaec8f76cb5e3 /utils/TableGen/DAGISelEmitter.h | |
parent | dfdaeb276e50baea18abbe30a85f1c206bb3d154 (diff) | |
download | external_llvm-efe9f4a3b69eb2a31f006476996c8ef722345193.zip external_llvm-efe9f4a3b69eb2a31f006476996c8ef722345193.tar.gz external_llvm-efe9f4a3b69eb2a31f006476996c8ef722345193.tar.bz2 |
Parse PredicateOperand's. When an instruction takes one, have the generated
isel fill in the instruction operands with the 'execute always' value
automatically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelEmitter.h')
-rw-r--r-- | utils/TableGen/DAGISelEmitter.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/TableGen/DAGISelEmitter.h b/utils/TableGen/DAGISelEmitter.h index e503036..a832b7d 100644 --- a/utils/TableGen/DAGISelEmitter.h +++ b/utils/TableGen/DAGISelEmitter.h @@ -343,6 +343,11 @@ namespace llvm { TreePatternNode *ParseTreePattern(DagInit *DI); }; + /// DAGPredicateOperand - One of these is created for each PredicateOperand + /// that has a set ExecuteAlways field. + struct DAGPredicateOperand { + std::vector<TreePatternNode*> AlwaysOps; + }; class DAGInstruction { TreePattern *Pattern; @@ -425,6 +430,7 @@ private: std::map<Record*, std::pair<Record*, std::string> > SDNodeXForms; std::map<Record*, ComplexPattern> ComplexPatterns; std::map<Record*, TreePattern*> PatternFragments; + std::map<Record*, DAGPredicateOperand> PredicateOperands; std::map<Record*, DAGInstruction> Instructions; // Specific SDNode definitions: @@ -479,6 +485,11 @@ public: abort(); } + const DAGPredicateOperand &getPredicateOperand(Record *R) { + assert(PredicateOperands.count(R) &&"Isn't an analyzed predicate operand!"); + return PredicateOperands.find(R)->second; + } + TreePattern *getPatternFragment(Record *R) const { assert(PatternFragments.count(R) && "Invalid pattern fragment request!"); return PatternFragments.find(R)->second; @@ -505,6 +516,7 @@ private: void ParseNodeTransforms(std::ostream &OS); void ParseComplexPatterns(); void ParsePatternFragments(std::ostream &OS); + void ParsePredicateOperands(); void ParseInstructions(); void ParsePatterns(); void GenerateVariants(); |