diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-02-19 00:33:13 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-02-19 00:33:13 +0000 |
| commit | dc61962e67cc49444c74c1bc7d4a9664ce68d961 (patch) | |
| tree | 56817e9b42f85e7fa7784648a839cd2472e9e8bf | |
| parent | aef662206bce972589df4294bc5e299403bf6af6 (diff) | |
| download | bcm5719-llvm-dc61962e67cc49444c74c1bc7d4a9664ce68d961.tar.gz bcm5719-llvm-dc61962e67cc49444c74c1bc7d4a9664ce68d961.zip | |
I confused myself, temporaries will be recorded right along with other inputs.
llvm-svn: 96639
| -rw-r--r-- | llvm/utils/TableGen/DAGISelMatcherGen.cpp | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp index 9bf929ceead..d87f7378161 100644 --- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp +++ b/llvm/utils/TableGen/DAGISelMatcherGen.cpp @@ -21,35 +21,15 @@ namespace { /// matcher or it can be a temporary value created by the emitter for things /// like constants. class ResultVal { - unsigned Number : 30; - enum { - Recorded, Temporary - } Kind : 2; // True if temporary, false if recorded. + unsigned Number; public: - static ResultVal getRecorded(unsigned N) { + static ResultVal get(unsigned N) { ResultVal R; R.Number = N; - R.Kind = Recorded; - return R; - } - - static ResultVal getTemp(unsigned N) { - ResultVal R; - R.Number = N; - R.Kind = Temporary; return R; } - bool isTemp() const { return Kind == Temporary; } - bool isRecorded() const { return Kind == Recorded; } - - unsigned getTempNo() const { - assert(isTemp()); - return Number; - } - - unsigned getRecordedNo() const { - assert(isRecorded()); + unsigned getNumber() const { return Number; } }; @@ -74,10 +54,6 @@ namespace { /// record into. unsigned NextRecordedOperandNo; - /// NextTemporary - As we generate code, this indicates the next temporary - /// ID that will be generated. - unsigned NextTemporary; - /// InputChains - This maintains the position in the recorded nodes array of /// all of the recorded input chains. SmallVector<unsigned, 2> InputChains; @@ -123,7 +99,7 @@ namespace { MatcherGen::MatcherGen(const PatternToMatch &pattern, const CodeGenDAGPatterns &cgp) -: Pattern(pattern), CGP(cgp), NextRecordedOperandNo(0), NextTemporary(0), +: Pattern(pattern), CGP(cgp), NextRecordedOperandNo(0), Matcher(0), CurPredicate(0) { // We need to produce the matcher tree for the patterns source pattern. To do // this we need to match the structure as well as the types. To do the type @@ -449,7 +425,7 @@ void MatcherGen::EmitResultLeafAsOperand(const TreePatternNode *N, if (IntInit *II = dynamic_cast<IntInit*>(N->getLeafValue())) { AddMatcherNode(new EmitIntegerMatcherNode(II->getValue(),N->getTypeNum(0))); - ResultOps.push_back(ResultVal::getTemp(NextTemporary++)); + ResultOps.push_back(ResultVal::get(NextRecordedOperandNo++)); return; } @@ -458,13 +434,13 @@ void MatcherGen::EmitResultLeafAsOperand(const TreePatternNode *N, if (DI->getDef()->isSubClassOf("Register")) { AddMatcherNode(new EmitRegisterMatcherNode(DI->getDef(), N->getTypeNum(0))); - ResultOps.push_back(ResultVal::getTemp(NextTemporary++)); + ResultOps.push_back(ResultVal::get(NextRecordedOperandNo++)); return; } if (DI->getDef()->getName() == "zero_reg") { AddMatcherNode(new EmitRegisterMatcherNode(0, N->getTypeNum(0))); - ResultOps.push_back(ResultVal::getTemp(NextTemporary++)); + ResultOps.push_back(ResultVal::get(NextRecordedOperandNo++)); return; } |

