summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-07-18 15:37:47 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-07-18 15:38:28 -0700
commit6f5062bc67c775f2bf9b5dfd80f57adb541783fc (patch)
tree1fa671a9c3eacb117212497b9575c1660c58fef5
parent8ae76ea9554267a5cf482b7f0443080656e13a5a (diff)
downloadbinaryen-6f5062bc67c775f2bf9b5dfd80f57adb541783fc.tar.gz
binaryen-6f5062bc67c775f2bf9b5dfd80f57adb541783fc.tar.bz2
binaryen-6f5062bc67c775f2bf9b5dfd80f57adb541783fc.zip
refactor calling of MakeMultiple in relooper
-rw-r--r--src/cfg/Relooper.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/cfg/Relooper.cpp b/src/cfg/Relooper.cpp
index 348c3f894..6488b3d06 100644
--- a/src/cfg/Relooper.cpp
+++ b/src/cfg/Relooper.cpp
@@ -693,9 +693,8 @@ void Relooper::Calculate(Block *Entry) {
#endif
}
- Shape *MakeMultiple(BlockSet &Blocks, BlockSet& Entries, BlockBlockSetMap& IndependentGroups, Shape *Prev, BlockSet &NextEntries) {
+ Shape *MakeMultiple(BlockSet &Blocks, BlockSet& Entries, BlockBlockSetMap& IndependentGroups, BlockSet &NextEntries, bool IsCheckedMultiple) {
PrintDebug("creating multiple block with %d inner groups\n", IndependentGroups.size());
- bool Fused = !!(Shape::IsSimple(Prev));
MultipleShape *Multiple = new MultipleShape();
Notice(Multiple);
BlockSet CurrEntries;
@@ -724,8 +723,7 @@ void Relooper::Calculate(Block *Entry) {
}
}
Multiple->InnerMap[CurrEntry->Id] = Process(CurrBlocks, CurrEntries);
- // If we are not fused, then our entries will actually be checked
- if (!Fused) {
+ if (IsCheckedMultiple) {
CurrEntry->IsCheckedMultipleEntry = true;
}
}
@@ -855,7 +853,8 @@ void Relooper::Calculate(Block *Entry) {
if (IndependentGroups.size() > 0) {
// Some groups removable ==> Multiple
- Make(MakeMultiple(Blocks, *Entries, IndependentGroups, Prev, *NextEntries));
+ // checked multiple if prev is not simple (in which case we would be fused)
+ Make(MakeMultiple(Blocks, *Entries, IndependentGroups, *NextEntries, !(Shape::IsSimple(Prev))));
}
}
// No independent groups, must be loopable ==> Loop