Lines Matching refs:OS

59                            PredicateExpander &PE, raw_ostream &OS);
61 PredicateExpander &PE, raw_ostream &OS);
64 raw_ostream &OS);
66 PredicateExpander &PE, raw_ostream &OS);
68 PredicateExpander &PE, raw_ostream &OS);
70 PredicateExpander &PE, raw_ostream &OS);
75 void run(raw_ostream &OS);
80 ArrayRef<const Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) { in emitMacroFusionDecl() argument
81 OS << "#ifdef GET_" << Target.getName() << "_MACRO_FUSION_PRED_DECL\n"; in emitMacroFusionDecl()
82 OS << "#undef GET_" << Target.getName() << "_MACRO_FUSION_PRED_DECL\n\n"; in emitMacroFusionDecl()
83 OS << "namespace llvm {\n"; in emitMacroFusionDecl()
86 OS << "bool is" << Fusion->getName() << "(const TargetInstrInfo &, " in emitMacroFusionDecl()
92 OS << "} // end namespace llvm\n"; in emitMacroFusionDecl()
93 OS << "\n#endif\n"; in emitMacroFusionDecl()
97 ArrayRef<const Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) { in emitMacroFusionImpl() argument
98 OS << "#ifdef GET_" << Target.getName() << "_MACRO_FUSION_PRED_IMPL\n"; in emitMacroFusionImpl()
99 OS << "#undef GET_" << Target.getName() << "_MACRO_FUSION_PRED_IMPL\n\n"; in emitMacroFusionImpl()
100 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) in emitMacroFusionImpl()
115 emitPredicates(Predicates, IsCommutable, PE, OS); in emitMacroFusionImpl()
117 OS.indent(2) << "return true;\n"; in emitMacroFusionImpl()
118 OS << "}\n"; in emitMacroFusionImpl()
121 OS << "} // end namespace llvm\n"; in emitMacroFusionImpl()
122 OS << "\n#endif\n"; in emitMacroFusionImpl()
127 PredicateExpander &PE, raw_ostream &OS) { in emitPredicates() argument
131 emitFirstPredicate(Predicate, IsCommutable, PE, OS); in emitPredicates()
133 emitSecondPredicate(Predicate, IsCommutable, PE, OS); in emitPredicates()
135 emitBothPredicate(Predicate, IsCommutable, PE, OS); in emitPredicates()
145 raw_ostream &OS) { in emitFirstPredicate() argument
147 OS.indent(2) << "if (!FirstMI)\n"; in emitFirstPredicate()
148 OS.indent(2) << " return " in emitFirstPredicate()
152 OS.indent(2) << "{\n"; in emitFirstPredicate()
153 OS.indent(4) << "Register FirstDest = FirstMI->getOperand(0).getReg();\n"; in emitFirstPredicate()
154 OS.indent(4) in emitFirstPredicate()
156 OS.indent(4) << " return false;\n"; in emitFirstPredicate()
157 OS.indent(2) << "}\n"; in emitFirstPredicate()
162 OS.indent(2) << "if (!FirstMI->getOperand(" << FirstOpIdx in emitFirstPredicate()
164 OS.indent(4) << "if (FirstMI->getOperand(" << FirstOpIdx in emitFirstPredicate()
169 OS << " {\n"; in emitFirstPredicate()
170 OS.indent(6) << "if (!FirstMI->getDesc().isCommutable())\n"; in emitFirstPredicate()
171 OS.indent(6) << " return false;\n"; in emitFirstPredicate()
173 OS.indent(6) in emitFirstPredicate()
176 OS.indent(6) in emitFirstPredicate()
178 OS.indent(6) in emitFirstPredicate()
181 OS.indent(6) << " return false;\n"; in emitFirstPredicate()
182 OS.indent(4) << "}\n"; in emitFirstPredicate()
184 OS << "\n"; in emitFirstPredicate()
185 OS.indent(4) << " return false;\n"; in emitFirstPredicate()
187 OS.indent(2) << "}\n"; in emitFirstPredicate()
189 OS.indent(2) << "{\n"; in emitFirstPredicate()
190 OS.indent(4) << "const MachineInstr *MI = FirstMI;\n"; in emitFirstPredicate()
191 OS.indent(4) << "if ("; in emitFirstPredicate()
194 PE.expandPredicate(OS, Predicate->getValueAsDef("Predicate")); in emitFirstPredicate()
195 OS << ")\n"; in emitFirstPredicate()
196 OS.indent(4) << " return false;\n"; in emitFirstPredicate()
197 OS.indent(2) << "}\n"; in emitFirstPredicate()
208 raw_ostream &OS) { in emitSecondPredicate() argument
210 OS.indent(2) << "{\n"; in emitSecondPredicate()
211 OS.indent(4) << "const MachineInstr *MI = &SecondMI;\n"; in emitSecondPredicate()
212 OS.indent(4) << "if ("; in emitSecondPredicate()
215 PE.expandPredicate(OS, Predicate->getValueAsDef("Predicate")); in emitSecondPredicate()
216 OS << ")\n"; in emitSecondPredicate()
217 OS.indent(4) << " return false;\n"; in emitSecondPredicate()
218 OS.indent(2) << "}\n"; in emitSecondPredicate()
223 OS.indent(2) << "if (!SecondMI.getOperand(" << FirstOpIdx in emitSecondPredicate()
225 OS.indent(4) << "if (SecondMI.getOperand(" << FirstOpIdx in emitSecondPredicate()
230 OS << " {\n"; in emitSecondPredicate()
231 OS.indent(6) << "if (!SecondMI.getDesc().isCommutable())\n"; in emitSecondPredicate()
232 OS.indent(6) << " return false;\n"; in emitSecondPredicate()
234 OS.indent(6) in emitSecondPredicate()
237 OS.indent(6) in emitSecondPredicate()
239 OS.indent(6) in emitSecondPredicate()
242 OS.indent(6) << " return false;\n"; in emitSecondPredicate()
243 OS.indent(4) << "}\n"; in emitSecondPredicate()
245 OS << "\n"; in emitSecondPredicate()
246 OS.indent(4) << " return false;\n"; in emitSecondPredicate()
248 OS.indent(2) << "}\n"; in emitSecondPredicate()
259 raw_ostream &OS) { in emitBothPredicate() argument
261 OS << Predicate->getValueAsString("Predicate"); in emitBothPredicate()
263 emitFirstPredicate(Predicate, IsCommutable, PE, OS); in emitBothPredicate()
264 emitSecondPredicate(Predicate, IsCommutable, PE, OS); in emitBothPredicate()
268 OS.indent(2) << "if (!(FirstMI->getOperand(" << FirstOpIdx in emitBothPredicate()
270 OS.indent(2) << " SecondMI.getOperand(" << SecondOpIdx in emitBothPredicate()
272 OS.indent(2) << " FirstMI->getOperand(" << FirstOpIdx in emitBothPredicate()
277 OS << " {\n"; in emitBothPredicate()
278 OS.indent(4) << "if (!SecondMI.getDesc().isCommutable())\n"; in emitBothPredicate()
279 OS.indent(4) << " return false;\n"; in emitBothPredicate()
281 OS.indent(4) in emitBothPredicate()
284 OS.indent(4) in emitBothPredicate()
286 OS.indent(4) in emitBothPredicate()
289 OS.indent(4) << " return false;\n"; in emitBothPredicate()
290 OS.indent(2) << "}"; in emitBothPredicate()
292 OS << "\n"; in emitBothPredicate()
293 OS.indent(2) << " return false;"; in emitBothPredicate()
295 OS << "\n"; in emitBothPredicate()
303 void MacroFusionPredicatorEmitter::run(raw_ostream &OS) { in run() argument
305 emitSourceFileHeader("Macro Fusion Predicators", OS); in run()
312 emitMacroFusionDecl(Fusions, PE, OS); in run()
313 OS << "\n"; in run()
314 emitMacroFusionImpl(Fusions, PE, OS); in run()