OLD | NEW |
1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// | 1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) 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 // This file implements the CfgNode class, including the complexities | 10 // This file implements the CfgNode class, including the complexities |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 Inst->updateVars(this); | 97 Inst->updateVars(this); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 // This does part 2 of Phi lowering. For each Phi instruction at each | 101 // This does part 2 of Phi lowering. For each Phi instruction at each |
102 // out-edge, create a corresponding assignment instruction, and add | 102 // out-edge, create a corresponding assignment instruction, and add |
103 // all the assignments near the end of this block. They need to be | 103 // all the assignments near the end of this block. They need to be |
104 // added before any branch instruction, and also if the block ends | 104 // added before any branch instruction, and also if the block ends |
105 // with a compare instruction followed by a branch instruction that we | 105 // with a compare instruction followed by a branch instruction that we |
106 // may want to fuse, it's better to insert the new assignments before | 106 // may want to fuse, it's better to insert the new assignments before |
107 // the compare instruction. | 107 // the compare instruction. The tryOptimizedCmpxchgCmpBr() method |
| 108 // assumes this ordering of instructions. |
108 // | 109 // |
109 // Note that this transformation takes the Phi dest variables out of | 110 // Note that this transformation takes the Phi dest variables out of |
110 // SSA form, as there may be assignments to the dest variable in | 111 // SSA form, as there may be assignments to the dest variable in |
111 // multiple blocks. | 112 // multiple blocks. |
112 // | 113 // |
113 // TODO: Defer this pass until after register allocation, then split | 114 // TODO: Defer this pass until after register allocation, then split |
114 // critical edges, add the assignments, and lower them. This should | 115 // critical edges, add the assignments, and lower them. This should |
115 // reduce the amount of shuffling at the end of each block. | 116 // reduce the amount of shuffling at the end of each block. |
116 void CfgNode::placePhiStores() { | 117 void CfgNode::placePhiStores() { |
117 // Find the insertion point. TODO: After branch/compare fusing is | 118 // Find the insertion point. TODO: After branch/compare fusing is |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 I != E; ++I) { | 485 I != E; ++I) { |
485 if (I != OutEdges.begin()) | 486 if (I != OutEdges.begin()) |
486 Str << ", "; | 487 Str << ", "; |
487 Str << "%" << (*I)->getName(); | 488 Str << "%" << (*I)->getName(); |
488 } | 489 } |
489 Str << "\n"; | 490 Str << "\n"; |
490 } | 491 } |
491 } | 492 } |
492 | 493 |
493 } // end of namespace Ice | 494 } // end of namespace Ice |
OLD | NEW |