Lines Matching refs:OS

61                            raw_ostream &OS);
63 raw_ostream &OS);
65 PredicateExpander &PE, raw_ostream &OS);
67 raw_ostream &OS);
69 raw_ostream &OS);
71 raw_ostream &OS);
76 void run(raw_ostream &OS);
81 std::vector<Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) { in emitMacroFusionDecl() argument
82 OS << "#ifdef GET_" << Target.getName() << "_MACRO_FUSION_PRED_DECL\n"; in emitMacroFusionDecl()
83 OS << "#undef GET_" << Target.getName() << "_MACRO_FUSION_PRED_DECL\n\n"; in emitMacroFusionDecl()
84 OS << "namespace llvm {\n"; in emitMacroFusionDecl()
87 OS << "bool is" << Fusion->getName() << "(const TargetInstrInfo &, " in emitMacroFusionDecl()
93 OS << "} // end namespace llvm\n"; in emitMacroFusionDecl()
94 OS << "\n#endif\n"; in emitMacroFusionDecl()
98 std::vector<Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) { in emitMacroFusionImpl() argument
99 OS << "#ifdef GET_" << Target.getName() << "_MACRO_FUSION_PRED_IMPL\n"; in emitMacroFusionImpl()
100 OS << "#undef GET_" << Target.getName() << "_MACRO_FUSION_PRED_IMPL\n\n"; in emitMacroFusionImpl()
101 OS << "namespace llvm {\n"; in emitMacroFusionImpl()
107 OS << "bool is" << Fusion->getName() << "(\n"; in emitMacroFusionImpl()
108 OS.indent(4) << "const TargetInstrInfo &TII,\n"; in emitMacroFusionImpl()
109 OS.indent(4) << "const TargetSubtargetInfo &STI,\n"; in emitMacroFusionImpl()
110 OS.indent(4) << "const MachineInstr *FirstMI,\n"; in emitMacroFusionImpl()
111 OS.indent(4) << "const MachineInstr &SecondMI) {\n"; in emitMacroFusionImpl()
112 OS.indent(2) << "auto &MRI = SecondMI.getMF()->getRegInfo();\n"; in emitMacroFusionImpl()
114 emitPredicates(Predicates, PE, OS); in emitMacroFusionImpl()
116 OS.indent(2) << "return true;\n"; in emitMacroFusionImpl()
117 OS << "}\n"; in emitMacroFusionImpl()
120 OS << "} // end namespace llvm\n"; in emitMacroFusionImpl()
121 OS << "\n#endif\n"; in emitMacroFusionImpl()
125 std::vector<Record *> &Predicates, PredicateExpander &PE, raw_ostream &OS) { in emitPredicates() argument
129 emitFirstPredicate(Predicate, PE, OS); in emitPredicates()
131 emitSecondPredicate(Predicate, PE, OS); in emitPredicates()
133 emitBothPredicate(Predicate, PE, OS); in emitPredicates()
142 raw_ostream &OS) { in emitFirstPredicate() argument
144 OS.indent(2) << "if (!FirstMI)\n"; in emitFirstPredicate()
145 OS.indent(2) << " return " in emitFirstPredicate()
149 OS.indent(2) << "{\n"; in emitFirstPredicate()
150 OS.indent(4) << "Register FirstDest = FirstMI->getOperand(0).getReg();\n"; in emitFirstPredicate()
151 OS.indent(4) in emitFirstPredicate()
153 OS.indent(4) << " return false;\n"; in emitFirstPredicate()
154 OS.indent(2) << "}\n"; in emitFirstPredicate()
156 OS.indent(2) << "{\n"; in emitFirstPredicate()
157 OS.indent(4) << "const MachineInstr *MI = FirstMI;\n"; in emitFirstPredicate()
158 OS.indent(4) << "if ("; in emitFirstPredicate()
161 PE.expandPredicate(OS, Predicate->getValueAsDef("Predicate")); in emitFirstPredicate()
162 OS << ")\n"; in emitFirstPredicate()
163 OS.indent(4) << " return false;\n"; in emitFirstPredicate()
164 OS.indent(2) << "}\n"; in emitFirstPredicate()
174 raw_ostream &OS) { in emitSecondPredicate() argument
176 OS.indent(2) << "{\n"; in emitSecondPredicate()
177 OS.indent(4) << "const MachineInstr *MI = &SecondMI;\n"; in emitSecondPredicate()
178 OS.indent(4) << "if ("; in emitSecondPredicate()
181 PE.expandPredicate(OS, Predicate->getValueAsDef("Predicate")); in emitSecondPredicate()
182 OS << ")\n"; in emitSecondPredicate()
183 OS.indent(4) << " return false;\n"; in emitSecondPredicate()
184 OS.indent(2) << "}\n"; in emitSecondPredicate()
194 raw_ostream &OS) { in emitBothPredicate() argument
196 OS << Predicate->getValueAsString("Predicate"); in emitBothPredicate()
198 emitFirstPredicate(Predicate, PE, OS); in emitBothPredicate()
199 emitSecondPredicate(Predicate, PE, OS); in emitBothPredicate()
203 OS.indent(2) << "if (!(FirstMI->getOperand(" << FirstOpIdx in emitBothPredicate()
205 OS.indent(2) << " SecondMI.getOperand(" << SecondOpIdx in emitBothPredicate()
207 OS.indent(2) << " FirstMI->getOperand(" << FirstOpIdx in emitBothPredicate()
210 OS.indent(2) << " return false;\n"; in emitBothPredicate()
217 void MacroFusionPredicatorEmitter::run(raw_ostream &OS) { in run() argument
219 emitSourceFileHeader("Macro Fusion Predicators", OS); in run()
228 emitMacroFusionDecl(Fusions, PE, OS); in run()
229 OS << "\n"; in run()
230 emitMacroFusionImpl(Fusions, PE, OS); in run()