blob: be307141d82f5d7fc078638f0bd4d4b462c7f10d [file] [log] [blame]
Chris Lattner4a24c642005-09-03 01:14:03 +00001//===- DAGISelEmitter.h - Generate an instruction selector ------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Chris Lattner and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This tablegen backend emits a DAG instruction selector.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef DAGISEL_EMITTER_H
15#define DAGISEL_EMITTER_H
16
17#include "TableGenBackend.h"
18#include "CodeGenTarget.h"
19
20namespace llvm {
Chris Lattner54cb8fd2005-09-07 23:44:43 +000021 class Record;
Jeff Cohen8337b072005-09-10 02:00:02 +000022 struct Init;
Chris Lattnera28aec12005-09-15 22:23:50 +000023 class ListInit;
Chris Lattner54cb8fd2005-09-07 23:44:43 +000024 class DagInit;
Chris Lattner32707602005-09-08 23:22:48 +000025 class SDNodeInfo;
Chris Lattner54cb8fd2005-09-07 23:44:43 +000026 class TreePattern;
Chris Lattner32707602005-09-08 23:22:48 +000027 class TreePatternNode;
Chris Lattner54cb8fd2005-09-07 23:44:43 +000028 class DAGISelEmitter;
Chris Lattnerca559d02005-09-08 21:03:01 +000029
Chris Lattner3c7e18d2005-10-14 06:12:03 +000030 /// MVT::DAGISelGenValueType - These are some extended forms of MVT::ValueType
31 /// that we use as lattice values during type inferrence.
32 namespace MVT {
33 enum DAGISelGenValueType {
34 isFP = MVT::LAST_VALUETYPE,
35 isInt,
36 isUnknown
37 };
38 }
39
Chris Lattner33c92e92005-09-08 21:27:15 +000040 /// SDTypeConstraint - This is a discriminated union of constraints,
41 /// corresponding to the SDTypeConstraint tablegen class in Target.td.
42 struct SDTypeConstraint {
43 SDTypeConstraint(Record *R);
44
45 unsigned OperandNo; // The operand # this constraint applies to.
46 enum {
Chris Lattner03ebd802005-10-14 04:53:53 +000047 SDTCisVT, SDTCisInt, SDTCisFP, SDTCisSameAs, SDTCisVTSmallerThanOp,
48 SDTCisOpSmallerThanOp
Chris Lattner33c92e92005-09-08 21:27:15 +000049 } ConstraintType;
50
51 union { // The discriminated union.
52 struct {
53 MVT::ValueType VT;
54 } SDTCisVT_Info;
55 struct {
56 unsigned OtherOperandNum;
57 } SDTCisSameAs_Info;
58 struct {
59 unsigned OtherOperandNum;
60 } SDTCisVTSmallerThanOp_Info;
Chris Lattner03ebd802005-10-14 04:53:53 +000061 struct {
62 unsigned BigOperandNum;
63 } SDTCisOpSmallerThanOp_Info;
Chris Lattner33c92e92005-09-08 21:27:15 +000064 } x;
Chris Lattner32707602005-09-08 23:22:48 +000065
66 /// ApplyTypeConstraint - Given a node in a pattern, apply this type
67 /// constraint to the nodes operands. This returns true if it makes a
68 /// change, false otherwise. If a type contradiction is found, throw an
69 /// exception.
70 bool ApplyTypeConstraint(TreePatternNode *N, const SDNodeInfo &NodeInfo,
71 TreePattern &TP) const;
72
73 /// getOperandNum - Return the node corresponding to operand #OpNo in tree
74 /// N, which has NumResults results.
75 TreePatternNode *getOperandNum(unsigned OpNo, TreePatternNode *N,
76 unsigned NumResults) const;
Chris Lattner33c92e92005-09-08 21:27:15 +000077 };
78
Chris Lattnerca559d02005-09-08 21:03:01 +000079 /// SDNodeInfo - One of these records is created for each SDNode instance in
80 /// the target .td file. This represents the various dag nodes we will be
81 /// processing.
82 class SDNodeInfo {
83 Record *Def;
84 std::string EnumName;
85 std::string SDClassName;
Chris Lattnera1a68ae2005-09-28 18:28:29 +000086 unsigned Properties;
Chris Lattner32707602005-09-08 23:22:48 +000087 unsigned NumResults;
88 int NumOperands;
Chris Lattner33c92e92005-09-08 21:27:15 +000089 std::vector<SDTypeConstraint> TypeConstraints;
Chris Lattnerca559d02005-09-08 21:03:01 +000090 public:
91 SDNodeInfo(Record *R); // Parse the specified record.
92
Chris Lattner32707602005-09-08 23:22:48 +000093 unsigned getNumResults() const { return NumResults; }
Chris Lattner33c92e92005-09-08 21:27:15 +000094 int getNumOperands() const { return NumOperands; }
Chris Lattnerca559d02005-09-08 21:03:01 +000095 Record *getRecord() const { return Def; }
96 const std::string &getEnumName() const { return EnumName; }
97 const std::string &getSDClassName() const { return SDClassName; }
Chris Lattner33c92e92005-09-08 21:27:15 +000098
Chris Lattner32707602005-09-08 23:22:48 +000099 const std::vector<SDTypeConstraint> &getTypeConstraints() const {
Chris Lattner33c92e92005-09-08 21:27:15 +0000100 return TypeConstraints;
101 }
Chris Lattnera1a68ae2005-09-28 18:28:29 +0000102
103 // SelectionDAG node properties.
Chris Lattner7cf2fe62005-09-28 20:58:06 +0000104 enum SDNP { SDNPCommutative, SDNPAssociative };
Chris Lattnera1a68ae2005-09-28 18:28:29 +0000105
106 /// hasProperty - Return true if this node has the specified property.
107 ///
108 bool hasProperty(enum SDNP Prop) const { return Properties & (1 << Prop); }
Chris Lattner32707602005-09-08 23:22:48 +0000109
110 /// ApplyTypeConstraints - Given a node in a pattern, apply the type
111 /// constraints for this node to the operands of the node. This returns
112 /// true if it makes a change, false otherwise. If a type contradiction is
113 /// found, throw an exception.
114 bool ApplyTypeConstraints(TreePatternNode *N, TreePattern &TP) const {
115 bool MadeChange = false;
116 for (unsigned i = 0, e = TypeConstraints.size(); i != e; ++i)
117 MadeChange |= TypeConstraints[i].ApplyTypeConstraint(N, *this, TP);
118 return MadeChange;
119 }
Chris Lattnerca559d02005-09-08 21:03:01 +0000120 };
Chris Lattner4a24c642005-09-03 01:14:03 +0000121
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000122 /// FIXME: TreePatternNode's can be shared in some cases (due to dag-shaped
123 /// patterns), and as such should be ref counted. We currently just leak all
124 /// TreePatternNode objects!
125 class TreePatternNode {
126 /// The inferred type for this node, or MVT::LAST_VALUETYPE if it hasn't
127 /// been determined yet.
Chris Lattner3c7e18d2005-10-14 06:12:03 +0000128 unsigned char Ty;
129
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000130 /// Operator - The Record for the operator if this is an interior node (not
131 /// a leaf).
132 Record *Operator;
133
134 /// Val - The init value (e.g. the "GPRC" record, or "7") for a leaf.
135 ///
136 Init *Val;
137
138 /// Name - The name given to this node with the :$foo notation.
139 ///
140 std::string Name;
141
142 /// PredicateFn - The predicate function to execute on this node to check
143 /// for a match. If this string is empty, no predicate is involved.
144 std::string PredicateFn;
145
Chris Lattner24eeeb82005-09-13 21:51:00 +0000146 /// TransformFn - The transformation function to execute on this node before
147 /// it can be substituted into the resulting instruction on a pattern match.
Chris Lattnerb0276202005-09-14 22:55:26 +0000148 Record *TransformFn;
Chris Lattner24eeeb82005-09-13 21:51:00 +0000149
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000150 std::vector<TreePatternNode*> Children;
151 public:
152 TreePatternNode(Record *Op, const std::vector<TreePatternNode*> &Ch)
Chris Lattner3c7e18d2005-10-14 06:12:03 +0000153 : Ty(MVT::isUnknown), Operator(Op), Val(0), TransformFn(0),
Chris Lattnerb0276202005-09-14 22:55:26 +0000154 Children(Ch) {}
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000155 TreePatternNode(Init *val) // leaf ctor
Chris Lattner3c7e18d2005-10-14 06:12:03 +0000156 : Ty(MVT::isUnknown), Operator(0), Val(val), TransformFn(0) {}
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000157 ~TreePatternNode();
158
159 const std::string &getName() const { return Name; }
160 void setName(const std::string &N) { Name = N; }
161
162 bool isLeaf() const { return Val != 0; }
Chris Lattner3c7e18d2005-10-14 06:12:03 +0000163 bool hasTypeSet() const { return Ty < MVT::LAST_VALUETYPE; }
164 bool isTypeCompletelyUnknown() const {
165 return Ty == MVT::isUnknown;
166 }
167 MVT::ValueType getType() const {
168 assert(hasTypeSet() && "Doesn't have a type yet!");
169 return (MVT::ValueType)Ty;
170 }
171 unsigned char getExtType() const { return Ty; }
172 void setType(unsigned char VT) { Ty = VT; }
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000173
174 Init *getLeafValue() const { assert(isLeaf()); return Val; }
175 Record *getOperator() const { assert(!isLeaf()); return Operator; }
176
177 unsigned getNumChildren() const { return Children.size(); }
178 TreePatternNode *getChild(unsigned N) const { return Children[N]; }
179 void setChild(unsigned i, TreePatternNode *N) {
180 Children[i] = N;
181 }
182
183 const std::string &getPredicateFn() const { return PredicateFn; }
184 void setPredicateFn(const std::string &Fn) { PredicateFn = Fn; }
Chris Lattner24eeeb82005-09-13 21:51:00 +0000185
Chris Lattnerb0276202005-09-14 22:55:26 +0000186 Record *getTransformFn() const { return TransformFn; }
187 void setTransformFn(Record *Fn) { TransformFn = Fn; }
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000188
189 void print(std::ostream &OS) const;
190 void dump() const;
191
192 public: // Higher level manipulation routines.
193
194 /// clone - Return a new copy of this tree.
195 ///
196 TreePatternNode *clone() const;
197
Chris Lattnere46e17b2005-09-29 19:28:10 +0000198 /// isIsomorphicTo - Return true if this node is recursively isomorphic to
199 /// the specified node. For this comparison, all of the state of the node
200 /// is considered, except for the assigned name. Nodes with differing names
201 /// that are otherwise identical are considered isomorphic.
202 bool isIsomorphicTo(const TreePatternNode *N) const;
203
Chris Lattner32707602005-09-08 23:22:48 +0000204 /// SubstituteFormalArguments - Replace the formal arguments in this tree
205 /// with actual values specified by ArgMap.
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000206 void SubstituteFormalArguments(std::map<std::string,
207 TreePatternNode*> &ArgMap);
208
209 /// InlinePatternFragments - If this pattern refers to any pattern
210 /// fragments, inline them into place, giving us a pattern without any
211 /// PatFrag references.
212 TreePatternNode *InlinePatternFragments(TreePattern &TP);
Chris Lattner32707602005-09-08 23:22:48 +0000213
214 /// ApplyTypeConstraints - Apply all of the type constraints relevent to
215 /// this node and its children in the tree. This returns true if it makes a
216 /// change, false otherwise. If a type contradiction is found, throw an
217 /// exception.
Chris Lattner0ee7cff2005-10-14 04:11:13 +0000218 bool ApplyTypeConstraints(TreePattern &TP, bool NotRegisters);
Chris Lattner32707602005-09-08 23:22:48 +0000219
220 /// UpdateNodeType - Set the node type of N to VT if VT contains
221 /// information. If N already contains a conflicting type, then throw an
222 /// exception. This returns true if any information was updated.
223 ///
Chris Lattner3c7e18d2005-10-14 06:12:03 +0000224 bool UpdateNodeType(unsigned char EVT, TreePattern &TP);
Chris Lattner32707602005-09-08 23:22:48 +0000225
226 /// ContainsUnresolvedType - Return true if this tree contains any
227 /// unresolved types.
228 bool ContainsUnresolvedType() const {
Chris Lattner2ac85102005-10-19 04:12:14 +0000229 if (!hasTypeSet()) return true;
Chris Lattner32707602005-09-08 23:22:48 +0000230 for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
231 if (getChild(i)->ContainsUnresolvedType()) return true;
232 return false;
233 }
Chris Lattnere97603f2005-09-28 19:27:25 +0000234
Chris Lattner7cf2fe62005-09-28 20:58:06 +0000235 /// canPatternMatch - If it is impossible for this pattern to match on this
236 /// target, fill in Reason and return false. Otherwise, return true.
Chris Lattnere97603f2005-09-28 19:27:25 +0000237 bool canPatternMatch(std::string &Reason, DAGISelEmitter &ISE);
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000238 };
239
240
Chris Lattneree9f0c32005-09-13 21:20:49 +0000241 /// TreePattern - Represent a pattern, used for instructions, pattern
242 /// fragments, etc.
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000243 ///
244 class TreePattern {
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000245 /// Trees - The list of pattern trees which corresponds to this pattern.
246 /// Note that PatFrag's only have a single tree.
247 ///
248 std::vector<TreePatternNode*> Trees;
249
250 /// TheRecord - The actual TableGen record corresponding to this pattern.
251 ///
252 Record *TheRecord;
253
254 /// Args - This is a list of all of the arguments to this pattern (for
255 /// PatFrag patterns), which are the 'node' markers in this pattern.
256 std::vector<std::string> Args;
257
258 /// ISE - the DAG isel emitter coordinating this madness.
259 ///
260 DAGISelEmitter &ISE;
Chris Lattneredbd8712005-10-21 01:19:59 +0000261
262 /// isInputPattern - True if this is an input pattern, something to match.
263 /// False if this is an output pattern, something to emit.
264 bool isInputPattern;
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000265 public:
266
267 /// TreePattern constructor - Parse the specified DagInits into the
268 /// current record.
Chris Lattneredbd8712005-10-21 01:19:59 +0000269 TreePattern(Record *TheRec, ListInit *RawPat, bool isInput,
270 DAGISelEmitter &ise);
271 TreePattern(Record *TheRec, DagInit *Pat, bool isInput,
272 DAGISelEmitter &ise);
273 TreePattern(Record *TheRec, TreePatternNode *Pat, bool isInput,
274 DAGISelEmitter &ise);
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000275
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000276 /// getTrees - Return the tree patterns which corresponds to this pattern.
277 ///
278 const std::vector<TreePatternNode*> &getTrees() const { return Trees; }
Chris Lattner20180052005-09-09 01:11:17 +0000279 unsigned getNumTrees() const { return Trees.size(); }
280 TreePatternNode *getTree(unsigned i) const { return Trees[i]; }
Chris Lattner37937092005-09-09 01:15:01 +0000281 TreePatternNode *getOnlyTree() const {
282 assert(Trees.size() == 1 && "Doesn't have exactly one pattern!");
283 return Trees[0];
284 }
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000285
286 /// getRecord - Return the actual TableGen record corresponding to this
287 /// pattern.
288 ///
289 Record *getRecord() const { return TheRecord; }
290
291 unsigned getNumArgs() const { return Args.size(); }
292 const std::string &getArgName(unsigned i) const {
293 assert(i < Args.size() && "Argument reference out of range!");
294 return Args[i];
295 }
Chris Lattneree9f0c32005-09-13 21:20:49 +0000296 std::vector<std::string> &getArgList() { return Args; }
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000297
298 DAGISelEmitter &getDAGISelEmitter() const { return ISE; }
299
300 /// InlinePatternFragments - If this pattern refers to any pattern
301 /// fragments, inline them into place, giving us a pattern without any
302 /// PatFrag references.
303 void InlinePatternFragments() {
304 for (unsigned i = 0, e = Trees.size(); i != e; ++i)
305 Trees[i] = Trees[i]->InlinePatternFragments(*this);
306 }
307
Chris Lattner32707602005-09-08 23:22:48 +0000308 /// InferAllTypes - Infer/propagate as many types throughout the expression
309 /// patterns as possible. Return true if all types are infered, false
310 /// otherwise. Throw an exception if a type contradiction is found.
311 bool InferAllTypes();
312
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000313 /// error - Throw an exception, prefixing it with information about this
314 /// pattern.
315 void error(const std::string &Msg) const;
316
317 void print(std::ostream &OS) const;
318 void dump() const;
319
320 private:
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000321 TreePatternNode *ParseTreePattern(DagInit *DI);
322 };
Chris Lattnerec676432005-09-14 04:03:16 +0000323
324
325 class DAGInstruction {
326 TreePattern *Pattern;
327 unsigned NumResults;
328 unsigned NumOperands;
Chris Lattnerae6d8282005-09-15 21:51:12 +0000329 std::vector<MVT::ValueType> ResultTypes;
330 std::vector<MVT::ValueType> OperandTypes;
Chris Lattnerb0276202005-09-14 22:55:26 +0000331 TreePatternNode *ResultPattern;
Chris Lattnerec676432005-09-14 04:03:16 +0000332 public:
Chris Lattnerae6d8282005-09-15 21:51:12 +0000333 DAGInstruction(TreePattern *TP,
334 const std::vector<MVT::ValueType> &resultTypes,
Chris Lattnera28aec12005-09-15 22:23:50 +0000335 const std::vector<MVT::ValueType> &operandTypes)
Chris Lattnerae6d8282005-09-15 21:51:12 +0000336 : Pattern(TP), ResultTypes(resultTypes), OperandTypes(operandTypes),
Chris Lattnera28aec12005-09-15 22:23:50 +0000337 ResultPattern(0) {}
Chris Lattnerec676432005-09-14 04:03:16 +0000338
Chris Lattnerec676432005-09-14 04:03:16 +0000339 TreePattern *getPattern() const { return Pattern; }
Chris Lattnerae6d8282005-09-15 21:51:12 +0000340 unsigned getNumResults() const { return ResultTypes.size(); }
341 unsigned getNumOperands() const { return OperandTypes.size(); }
342
Chris Lattnera28aec12005-09-15 22:23:50 +0000343 void setResultPattern(TreePatternNode *R) { ResultPattern = R; }
344
Chris Lattnerae6d8282005-09-15 21:51:12 +0000345 MVT::ValueType getResultType(unsigned RN) const {
346 assert(RN < ResultTypes.size());
347 return ResultTypes[RN];
348 }
349
350 MVT::ValueType getOperandType(unsigned ON) const {
351 assert(ON < OperandTypes.size());
352 return OperandTypes[ON];
353 }
Chris Lattnerb0276202005-09-14 22:55:26 +0000354 TreePatternNode *getResultPattern() const { return ResultPattern; }
Chris Lattnerec676432005-09-14 04:03:16 +0000355 };
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000356
357
Chris Lattner4a24c642005-09-03 01:14:03 +0000358/// InstrSelectorEmitter - The top-level class which coordinates construction
359/// and emission of the instruction selector.
360///
361class DAGISelEmitter : public TableGenBackend {
Chris Lattner3f7e9142005-09-23 20:52:47 +0000362public:
363 typedef std::pair<TreePatternNode*, TreePatternNode*> PatternToMatch;
364private:
Chris Lattner4a24c642005-09-03 01:14:03 +0000365 RecordKeeper &Records;
366 CodeGenTarget Target;
367
Chris Lattnerca559d02005-09-08 21:03:01 +0000368 std::map<Record*, SDNodeInfo> SDNodes;
Chris Lattner24eeeb82005-09-13 21:51:00 +0000369 std::map<Record*, std::pair<Record*, std::string> > SDNodeXForms;
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000370 std::map<Record*, TreePattern*> PatternFragments;
Chris Lattnerae5b3502005-09-15 21:57:35 +0000371 std::map<Record*, DAGInstruction> Instructions;
Chris Lattner1f39e292005-09-14 00:09:24 +0000372
373 /// PatternsToMatch - All of the things we are matching on the DAG. The first
374 /// value is the pattern to match, the second pattern is the result to
375 /// emit.
Chris Lattner81303322005-09-23 19:36:15 +0000376 std::vector<PatternToMatch> PatternsToMatch;
Chris Lattner4a24c642005-09-03 01:14:03 +0000377public:
378 DAGISelEmitter(RecordKeeper &R) : Records(R) {}
379
380 // run - Output the isel, returning true on failure.
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000381 void run(std::ostream &OS);
Chris Lattnerca559d02005-09-08 21:03:01 +0000382
Chris Lattner0ee7cff2005-10-14 04:11:13 +0000383 const CodeGenTarget &getTargetInfo() const { return Target; }
384
Chris Lattner0614b622005-11-02 06:49:14 +0000385 Record *getSDNodeNamed(const std::string &Name) const;
386
Chris Lattnerca559d02005-09-08 21:03:01 +0000387 const SDNodeInfo &getSDNodeInfo(Record *R) const {
388 assert(SDNodes.count(R) && "Unknown node!");
389 return SDNodes.find(R)->second;
390 }
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000391
392 TreePattern *getPatternFragment(Record *R) const {
393 assert(PatternFragments.count(R) && "Invalid pattern fragment request!");
394 return PatternFragments.find(R)->second;
395 }
396
Chris Lattner6de8b532005-09-13 21:59:15 +0000397 const std::pair<Record*, std::string> &getSDNodeTransform(Record *R) const {
398 assert(SDNodeXForms.count(R) && "Invalid transform!");
399 return SDNodeXForms.find(R)->second;
400 }
401
Chris Lattnerae5b3502005-09-15 21:57:35 +0000402 const DAGInstruction &getInstruction(Record *R) const {
403 assert(Instructions.count(R) && "Unknown instruction!");
404 return Instructions.find(R)->second;
405 }
406
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000407private:
Chris Lattnerca559d02005-09-08 21:03:01 +0000408 void ParseNodeInfo();
Chris Lattner24eeeb82005-09-13 21:51:00 +0000409 void ParseNodeTransforms(std::ostream &OS);
Chris Lattnerb39e4be2005-09-15 02:38:02 +0000410 void ParsePatternFragments(std::ostream &OS);
411 void ParseInstructions();
412 void ParsePatterns();
Chris Lattnere97603f2005-09-28 19:27:25 +0000413 void GenerateVariants();
Chris Lattnerd8a3bde2005-09-14 20:53:42 +0000414 void FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,
415 std::map<std::string,
416 TreePatternNode*> &InstInputs,
417 std::map<std::string, Record*> &InstResults);
Chris Lattnerd1ff35a2005-09-23 21:33:23 +0000418 void EmitMatchForPattern(TreePatternNode *N, const std::string &RootName,
Chris Lattner8fc35682005-09-23 23:16:51 +0000419 std::map<std::string,std::string> &VarMap,
Chris Lattnerd1ff35a2005-09-23 21:33:23 +0000420 unsigned PatternNo, std::ostream &OS);
Chris Lattner72fe91c2005-09-24 00:40:24 +0000421 unsigned CodeGenPatternResult(TreePatternNode *N, unsigned &Ctr,
422 std::map<std::string,std::string> &VariableMap,
Chris Lattner5024d932005-10-16 01:41:58 +0000423 std::ostream &OS, bool isRoot = false);
Chris Lattner3f7e9142005-09-23 20:52:47 +0000424 void EmitCodeForPattern(PatternToMatch &Pattern, std::ostream &OS);
Chris Lattner54cb8fd2005-09-07 23:44:43 +0000425 void EmitInstructionSelector(std::ostream &OS);
Chris Lattner4a24c642005-09-03 01:14:03 +0000426};
427
428} // End llvm namespace
429
430#endif