From c78f2a39945339752a163949a2d7c27f28635d99 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 28 Feb 2010 20:49:53 +0000 Subject: enhance the new isel to use SelectNodeTo for most patterns, even some the old isel didn't. There are several parts of this that make me feel dirty, but it's no worse than the old isel. I'll clean up the parts I can do without ripping out the old one next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97415 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/DAGISelMatcherEmitter.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'utils/TableGen/DAGISelMatcherEmitter.cpp') diff --git a/utils/TableGen/DAGISelMatcherEmitter.cpp b/utils/TableGen/DAGISelMatcherEmitter.cpp index 942a612..aec1e18 100644 --- a/utils/TableGen/DAGISelMatcherEmitter.cpp +++ b/utils/TableGen/DAGISelMatcherEmitter.cpp @@ -416,18 +416,23 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx, // Print the result #'s for EmitNode. if (const EmitNodeMatcher *E = dyn_cast(EN)) { - if (EN->getVT(0) != MVT::Flag && EN->getVT(0) != MVT::Other) { + if (unsigned NumResults = EN->getNumNonChainFlagVTs()) { OS.PadToColumn(CommentIndent) << "// Results = "; unsigned First = E->getFirstResultSlot(); - for (unsigned i = 0, e = EN->getNumVTs(); i != e; ++i) { - if (EN->getVT(0) == MVT::Flag || EN->getVT(0) == MVT::Other) - break; + for (unsigned i = 0; i != NumResults; ++i) OS << "#" << First+i << " "; - } } } - OS << '\n'; + + if (const SelectNodeToMatcher *SNT = dyn_cast(N)) { + OS.PadToColumn(Indent*2) << "// Src: " + << *SNT->getPattern().getSrcPattern() << '\n'; + OS.PadToColumn(Indent*2) << "// Dst: " + << *SNT->getPattern().getDstPattern() << '\n'; + + } + return 6+EN->getNumVTs()+NumOperandBytes; } case Matcher::MarkFlagResults: { -- cgit v1.1