Chromium Code Reviews| Index: lib/compiler/implementation/ssa/validate.dart |
| =================================================================== |
| --- lib/compiler/implementation/ssa/validate.dart (revision 8084) |
| +++ lib/compiler/implementation/ssa/validate.dart (working copy) |
| @@ -82,6 +82,28 @@ |
| if (!isValid) return; |
| block.forEachPhi(visitInstruction); |
| + |
| + // Make sure the parameters of a phi are dominating the |
| + // corresponding predecessor block. |
|
Lasse Reichstein Nielsen
2012/05/30 09:35:14
We usually use "dominating" about blocks, not inst
ngeoffray
2012/05/30 10:19:07
Done.
|
| + block.forEachPhi((HPhi phi) { |
| + for (int i = 0; i < phi.inputs.length; i++) { |
| + HInstruction input = phi.inputs[i]; |
| + if (!input.block.dominates(block.predecessors[i])) { |
| + markInvalid("Definition does not dominate use"); |
| + } |
| + } |
| + }); |
| + |
| + // Make sure the inputs of an instruction dominate the |
| + // instruction. |
| + block.forEachInstruction((HInstruction instruction) { |
| + for (HInstruction input in instruction.inputs) { |
|
Lasse Reichstein Nielsen
2012/05/30 09:35:14
This is an un-pretty combination of functional for
ngeoffray
2012/05/30 10:19:07
As discussed, it doesn't look un-pretty to me, as
|
| + if (!input.block.dominates(block)) { |
| + markInvalid("Definition does not dominate use"); |
| + } |
| + } |
| + }); |
| + |
| super.visitBasicBlock(block); |
| } |