| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 assert(Phi); | 254 assert(Phi); |
| 255 for (SizeT i = 0; i < InEdges.size(); ++i) { | 255 for (SizeT i = 0; i < InEdges.size(); ++i) { |
| 256 Phi->setLabel(i, InEdges[i]); | 256 Phi->setLabel(i, InEdges[i]); |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 | 261 |
| 262 void Cfg::computeInOutEdges() { | 262 void Cfg::computeInOutEdges() { |
| 263 // Compute the out-edges. | 263 // Compute the out-edges. |
| 264 for (CfgNode *Node : Nodes) | 264 for (CfgNode *Node : Nodes) { |
| 265 Node->computeSuccessors(); | 265 Node->computeSuccessors(); |
| 266 } |
| 266 | 267 |
| 267 // Prune any unreachable nodes before computing in-edges. | 268 // Prune any unreachable nodes before computing in-edges. |
| 268 SizeT NumNodes = getNumNodes(); | 269 SizeT NumNodes = getNumNodes(); |
| 269 BitVector Reachable(NumNodes); | 270 BitVector Reachable(NumNodes); |
| 270 BitVector Pending(NumNodes); | 271 BitVector Pending(NumNodes); |
| 271 Pending.set(getEntryNode()->getIndex()); | 272 Pending.set(getEntryNode()->getIndex()); |
| 272 while (true) { | 273 while (true) { |
| 273 int Index = Pending.find_first(); | 274 int Index = Pending.find_first(); |
| 274 if (Index == -1) | 275 if (Index == -1) |
| 275 break; | 276 break; |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 } | 1167 } |
| 1167 } | 1168 } |
| 1168 // Print each basic block | 1169 // Print each basic block |
| 1169 for (CfgNode *Node : Nodes) | 1170 for (CfgNode *Node : Nodes) |
| 1170 Node->dump(this); | 1171 Node->dump(this); |
| 1171 if (isVerbose(IceV_Instructions)) | 1172 if (isVerbose(IceV_Instructions)) |
| 1172 Str << "}\n"; | 1173 Str << "}\n"; |
| 1173 } | 1174 } |
| 1174 | 1175 |
| 1175 } // end of namespace Ice | 1176 } // end of namespace Ice |
| OLD | NEW |