Lines Matching refs:OS

59                            raw_ostream &OS);
61 raw_ostream &OS);
63 PredicateExpander &PE, raw_ostream &OS);
65 PredicateExpander &PE, raw_ostream &OS);
67 PredicateExpander &PE, raw_ostream &OS);
69 PredicateExpander &PE, raw_ostream &OS);
74 void run(raw_ostream &OS);
79 ArrayRef<Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) { in emitMacroFusionDecl() argument
80 OS << "#ifdef GET_" << Target.getName() << "_MACRO_FUSION_PRED_DECL\n"; in emitMacroFusionDecl()
81 OS << "#undef GET_" << Target.getName() << "_MACRO_FUSION_PRED_DECL\n\n"; in emitMacroFusionDecl()
82 OS << "namespace llvm {\n"; in emitMacroFusionDecl()
85 OS << "bool is" << Fusion->getName() << "(const TargetInstrInfo &, " in emitMacroFusionDecl()
91 OS << "} // end namespace llvm\n"; in emitMacroFusionDecl()
92 OS << "\n#endif\n"; in emitMacroFusionDecl()
96 ArrayRef<Record *> Fusions, PredicateExpander &PE, raw_ostream &OS) { in emitMacroFusionImpl() argument
97 OS << "#ifdef GET_" << Target.getName() << "_MACRO_FUSION_PRED_IMPL\n"; in emitMacroFusionImpl()
98 OS << "#undef GET_" << Target.getName() << "_MACRO_FUSION_PRED_IMPL\n\n"; in emitMacroFusionImpl()
99 OS << "namespace llvm {\n"; in emitMacroFusionImpl()
106 OS << "bool is" << Fusion->getName() << "(\n"; in emitMacroFusionImpl()
107 OS.indent(4) << "const TargetInstrInfo &TII,\n"; in emitMacroFusionImpl()
108 OS.indent(4) << "const TargetSubtargetInfo &STI,\n"; in emitMacroFusionImpl()
109 OS.indent(4) << "const MachineInstr *FirstMI,\n"; in emitMacroFusionImpl()
110 OS.indent(4) << "const MachineInstr &SecondMI) {\n"; in emitMacroFusionImpl()
111 OS.indent(2) in emitMacroFusionImpl()
114 emitPredicates(Predicates, IsCommutable, 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()
127 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()
159 OS.indent(2) << "{\n"; in emitFirstPredicate()
160 OS.indent(4) << "const MachineInstr *MI = FirstMI;\n"; in emitFirstPredicate()
161 OS.indent(4) << "if ("; in emitFirstPredicate()
164 PE.expandPredicate(OS, Predicate->getValueAsDef("Predicate")); in emitFirstPredicate()
165 OS << ")\n"; in emitFirstPredicate()
166 OS.indent(4) << " return false;\n"; in emitFirstPredicate()
167 OS.indent(2) << "}\n"; in emitFirstPredicate()
178 raw_ostream &OS) { in emitSecondPredicate() argument
180 OS.indent(2) << "{\n"; in emitSecondPredicate()
181 OS.indent(4) << "const MachineInstr *MI = &SecondMI;\n"; in emitSecondPredicate()
182 OS.indent(4) << "if ("; in emitSecondPredicate()
185 PE.expandPredicate(OS, Predicate->getValueAsDef("Predicate")); in emitSecondPredicate()
186 OS << ")\n"; in emitSecondPredicate()
187 OS.indent(4) << " return false;\n"; in emitSecondPredicate()
188 OS.indent(2) << "}\n"; in emitSecondPredicate()
193 OS.indent(2) << "if (!SecondMI.getOperand(" << FirstOpIdx in emitSecondPredicate()
195 OS.indent(4) << "if (SecondMI.getOperand(" << FirstOpIdx in emitSecondPredicate()
200 OS << " {\n"; in emitSecondPredicate()
201 OS.indent(6) << "if (!SecondMI.getDesc().isCommutable())\n"; in emitSecondPredicate()
202 OS.indent(6) << " return false;\n"; in emitSecondPredicate()
204 OS.indent(6) in emitSecondPredicate()
207 OS.indent(6) in emitSecondPredicate()
209 OS.indent(6) in emitSecondPredicate()
212 OS.indent(6) << " return false;\n"; in emitSecondPredicate()
213 OS.indent(4) << "}\n"; in emitSecondPredicate()
215 OS << "\n"; in emitSecondPredicate()
216 OS.indent(4) << " return false;\n"; in emitSecondPredicate()
218 OS.indent(2) << "}\n"; in emitSecondPredicate()
229 raw_ostream &OS) { in emitBothPredicate() argument
231 OS << Predicate->getValueAsString("Predicate"); in emitBothPredicate()
233 emitFirstPredicate(Predicate, IsCommutable, PE, OS); in emitBothPredicate()
234 emitSecondPredicate(Predicate, IsCommutable, PE, OS); in emitBothPredicate()
238 OS.indent(2) << "if (!(FirstMI->getOperand(" << FirstOpIdx in emitBothPredicate()
240 OS.indent(2) << " SecondMI.getOperand(" << SecondOpIdx in emitBothPredicate()
242 OS.indent(2) << " FirstMI->getOperand(" << FirstOpIdx in emitBothPredicate()
247 OS << " {\n"; in emitBothPredicate()
248 OS.indent(4) << "if (!SecondMI.getDesc().isCommutable())\n"; in emitBothPredicate()
249 OS.indent(4) << " return false;\n"; in emitBothPredicate()
251 OS.indent(4) in emitBothPredicate()
254 OS.indent(4) in emitBothPredicate()
256 OS.indent(4) in emitBothPredicate()
259 OS.indent(4) << " return false;\n"; in emitBothPredicate()
260 OS.indent(2) << "}"; in emitBothPredicate()
262 OS << "\n"; in emitBothPredicate()
263 OS.indent(2) << " return false;"; in emitBothPredicate()
265 OS << "\n"; in emitBothPredicate()
272 void MacroFusionPredicatorEmitter::run(raw_ostream &OS) { in run() argument
274 emitSourceFileHeader("Macro Fusion Predicators", OS); in run()
283 emitMacroFusionDecl(Fusions, PE, OS); in run()
284 OS << "\n"; in run()
285 emitMacroFusionImpl(Fusions, PE, OS); in run()