| OLD | NEW |
| 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// | 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void Cfg::translate() { | 197 void Cfg::translate() { |
| 198 if (hasError()) | 198 if (hasError()) |
| 199 return; | 199 return; |
| 200 if (BuildDefs::timers()) { | 200 if (BuildDefs::timers()) { |
| 201 const std::string TimingFocusOn = getFlags().getTimingFocusOn(); | 201 const std::string TimingFocusOn = getFlags().getTimingFocusOn(); |
| 202 if (!TimingFocusOn.empty()) { | 202 if (!TimingFocusOn.empty()) { |
| 203 const std::string Name = getFunctionName().toString(); | 203 const std::string Name = getFunctionName().toString(); |
| 204 if (TimingFocusOn == "*" || TimingFocusOn == Name) { | 204 if (TimingFocusOn == "*" || TimingFocusOn == Name) { |
| 205 setFocusedTiming(); | 205 setFocusedTiming(); |
| 206 getContext()->resetTimer(GlobalContext::TSK_Default); | 206 getContext()->resetTimer(GlobalContext::TSK_Default); |
| 207 getContext()->setTimerName(GlobalContext::TSK_Default, Name); | |
| 208 } | 207 } |
| 209 } | 208 } |
| 210 } | 209 } |
| 211 if (BuildDefs::dump()) { | 210 if (BuildDefs::dump()) { |
| 212 if (isVerbose(IceV_Status)) { | 211 if (isVerbose(IceV_Status)) { |
| 213 getContext()->getStrDump() << ">>>Translating " | 212 getContext()->getStrDump() << ">>>Translating " |
| 214 << getFunctionNameAndSize() << "\n"; | 213 << getFunctionNameAndSize() << "\n"; |
| 215 } | 214 } |
| 216 } | 215 } |
| 217 TimerMarker T_func(getContext(), getFunctionName().toStringOrEmpty()); | 216 TimerMarker T_func(getContext(), getFunctionName().toStringOrEmpty()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 233 for (Variable *Var : Variables) | 232 for (Variable *Var : Variables) |
| 234 if (auto *Var64On32 = llvm::dyn_cast<Variable64On32>(Var)) | 233 if (auto *Var64On32 = llvm::dyn_cast<Variable64On32>(Var)) |
| 235 Var64On32->initHiLo(this); | 234 Var64On32->initHiLo(this); |
| 236 | 235 |
| 237 // The set of translation passes and their order are determined by the | 236 // The set of translation passes and their order are determined by the |
| 238 // target. | 237 // target. |
| 239 getTarget()->translate(); | 238 getTarget()->translate(); |
| 240 | 239 |
| 241 dump("Final output"); | 240 dump("Final output"); |
| 242 if (getFocusedTiming()) { | 241 if (getFocusedTiming()) { |
| 243 getContext()->mergeTimersFromTLS(); | 242 getContext()->dumpLocalTimers(getFunctionName().toString()); |
| 244 getContext()->dumpTimers(); | |
| 245 } | 243 } |
| 246 } | 244 } |
| 247 | 245 |
| 248 void Cfg::fixPhiNodes() { | 246 void Cfg::fixPhiNodes() { |
| 249 for (auto *Node : Nodes) { | 247 for (auto *Node : Nodes) { |
| 250 // Fix all the phi edges since WASM can't tell how to make them correctly at | 248 // Fix all the phi edges since WASM can't tell how to make them correctly at |
| 251 // the beginning. | 249 // the beginning. |
| 252 assert(Node); | 250 assert(Node); |
| 253 const auto &InEdges = Node->getInEdges(); | 251 const auto &InEdges = Node->getInEdges(); |
| 254 for (auto &Instr : Node->getPhis()) { | 252 for (auto &Instr : Node->getPhis()) { |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 } | 1165 } |
| 1168 } | 1166 } |
| 1169 // Print each basic block | 1167 // Print each basic block |
| 1170 for (CfgNode *Node : Nodes) | 1168 for (CfgNode *Node : Nodes) |
| 1171 Node->dump(this); | 1169 Node->dump(this); |
| 1172 if (isVerbose(IceV_Instructions)) | 1170 if (isVerbose(IceV_Instructions)) |
| 1173 Str << "}\n"; | 1171 Str << "}\n"; |
| 1174 } | 1172 } |
| 1175 | 1173 |
| 1176 } // end of namespace Ice | 1174 } // end of namespace Ice |
| OLD | NEW |