llvm.org GIT mirror llvm / ecf93e4
Stop emitting predicate functions. They are no longer used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112924 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 9 years ago
2 changed file(s) with 0 addition(s) and 50 deletion(s). Raw diff Collapse all Expand all
5454 for (unsigned i = 0, e = P->getNumChildren(); i != e; ++i)
5555 Cost += getResultPatternSize(P->getChild(i), CGP);
5656 return Cost;
57 }
58
59 //===----------------------------------------------------------------------===//
60 // Predicate emitter implementation.
61 //
62
63 void DAGISelEmitter::EmitPredicateFunctions(raw_ostream &OS) {
64 OS << "\n// Predicate functions.\n";
65
66 // Walk the pattern fragments, adding them to a map, which sorts them by
67 // name.
68 typedef std::map > PFsByNameTy;
69 PFsByNameTy PFsByName;
70
71 for (CodeGenDAGPatterns::pf_iterator I = CGP.pf_begin(), E = CGP.pf_end();
72 I != E; ++I)
73 PFsByName.insert(std::make_pair(I->first->getName(), *I));
74
75
76 for (PFsByNameTy::iterator I = PFsByName.begin(), E = PFsByName.end();
77 I != E; ++I) {
78 Record *PatFragRecord = I->second.first;// Record that derives from PatFrag.
79 TreePattern *P = I->second.second;
80
81 // If there is a code init for this fragment, emit the predicate code.
82 std::string Code = PatFragRecord->getValueAsCode("Predicate");
83 if (Code.empty()) continue;
84
85 if (P->getOnlyTree()->isLeaf())
86 OS << "inline bool Predicate_" << PatFragRecord->getName()
87 << "(SDNode *N) const {\n";
88 else {
89 std::string ClassName =
90 CGP.getSDNodeInfo(P->getOnlyTree()->getOperator()).getSDClassName();
91 const char *C2 = ClassName == "SDNode" ? "N" : "inN";
92
93 OS << "inline bool Predicate_" << PatFragRecord->getName()
94 << "(SDNode *" << C2 << ") const {\n";
95 if (ClassName != "SDNode")
96 OS << " " << ClassName << " *N = cast<" << ClassName << ">(inN);\n";
97 }
98 OS << Code << "\n}\n";
99 }
100
101 OS << "\n\n";
10257 }
10358
10459 namespace {
167122 errs() << "\n";
168123 });
169124
170 // FIXME: These are being used by hand written code, gross.
171 EmitPredicateFunctions(OS);
172
173125 // Add all the patterns to a temporary list so we can sort them.
174126 std::vector Patterns;
175127 for (CodeGenDAGPatterns::ptm_iterator I = CGP.ptm_begin(), E = CGP.ptm_end();
3030
3131 // run - Output the isel, returning true on failure.
3232 void run(raw_ostream &OS);
33 private:
34 void EmitPredicateFunctions(raw_ostream &OS);
3533 };
3634
3735 } // End llvm namespace