diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-04-16 14:12:00 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-04-16 14:12:00 -0700 |
commit | 0f8f1e94e02ead602699c816794d238e642ec1ca (patch) | |
tree | 5bace2a20c84013ab1aba7533511bb6ac993a294 /src/relooper/Relooper.h | |
parent | 11dfeed10d0fe74d9c47fd0396b87b99f7dde0dc (diff) |
optimize multiple shape to contain a map based on ids, not blocks, so we re-merge split nodes early
Diffstat (limited to 'src/relooper/Relooper.h')
-rw-r--r-- | src/relooper/Relooper.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/relooper/Relooper.h b/src/relooper/Relooper.h index 152bae0e..7d80e162 100644 --- a/src/relooper/Relooper.h +++ b/src/relooper/Relooper.h @@ -132,8 +132,6 @@ struct SimpleShape : public Shape { } }; -typedef std::map<Block*, Shape*> BlockShapeMap; - // A shape that may be implemented with a labeled loop. struct LabeledShape : public Shape { bool Labeled; // If we have a loop, whether it needs to be labeled @@ -141,8 +139,11 @@ struct LabeledShape : public Shape { LabeledShape(ShapeType TypeInit) : Shape(TypeInit), Labeled(false) {} }; +// Blocks with the same id were split and are identical, so we just care about ids in Multiple entries +typedef std::map<int, Shape*> IdShapeMap; + struct MultipleShape : public LabeledShape { - BlockShapeMap InnerMap; // entry block -> shape + IdShapeMap InnerMap; // entry block ID -> shape int NeedLoop; // If we have branches, we need a loop. This is a counter of loop requirements, // if we optimize it to 0, the loop is unneeded |