diff options
author | Roland Levillain <rpl@google.com> | 2014-09-22 17:13:44 +0100 |
---|---|---|
committer | Roland Levillain <rpl@google.com> | 2014-09-22 17:13:44 +0100 |
commit | 6b879ddc0959df1cec871f0d41f11cce35a11716 (patch) | |
tree | 7ca75abcea8c26601efe3d41d9e55bc24a835bad /compiler/optimizing/graph_checker.h | |
parent | ef3e89b9281525d6c084136c379346608b44d933 (diff) | |
download | art-6b879ddc0959df1cec871f0d41f11cce35a11716.tar.gz art-6b879ddc0959df1cec871f0d41f11cce35a11716.tar.bz2 art-6b879ddc0959df1cec871f0d41f11cce35a11716.zip |
Add loop- and phi-related checks in the optimizing compiler.
- Ensure the pre-header block is first in the list of
predecessors of a loop header.
- Ensure the loop header has only two predecessors and that
only the second one is the back edge.
- Ensure there is only one back edge per loop.
- Ensure the first input of a phi is not itself.
- Ensure the number of phi inputs is the same as the number
of its predecessors.
- Ensure phi input at index I either comes from the Ith
predecessor or from a block that dominates this
predecessor.
Change-Id: I4db5c68cfbc9b74d2d03125753d0143ece625378
Diffstat (limited to 'compiler/optimizing/graph_checker.h')
-rw-r--r-- | compiler/optimizing/graph_checker.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/optimizing/graph_checker.h b/compiler/optimizing/graph_checker.h index 8ddd399456..34a770b5f3 100644 --- a/compiler/optimizing/graph_checker.h +++ b/compiler/optimizing/graph_checker.h @@ -67,9 +67,12 @@ class SSAChecker : public GraphChecker { // Perform SSA form checks on `block`. virtual void VisitBasicBlock(HBasicBlock* block) OVERRIDE; + // Loop-related checks from block `loop_header`. + void CheckLoop(HBasicBlock* loop_header); - // Perform SSA form checks on `instruction`. + // Perform SSA form checks on instructions. virtual void VisitInstruction(HInstruction* instruction) OVERRIDE; + virtual void VisitPhi(HPhi* phi) OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(SSAChecker); |