aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-11-15 10:44:29 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-11-15 10:44:53 -0800
commitf6fd13590913b74fe4f728472c96c5cfdb9f84b0 (patch)
tree1853a670f7d327952add65631dc01f393d5769fe
parentdca9531043a4d6be43f63854eb27242bbdfe6d63 (diff)
option to hoist dead ends into loops
-rw-r--r--src/relooper/Relooper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/relooper/Relooper.cpp b/src/relooper/Relooper.cpp
index d79dca5a..0b4284bc 100644
--- a/src/relooper/Relooper.cpp
+++ b/src/relooper/Relooper.cpp
@@ -541,6 +541,16 @@ void Relooper::Calculate(Block *Entry) {
for (BlockSet::iterator iter = Curr->BranchesIn.begin(); iter != Curr->BranchesIn.end(); iter++) {
Queue.insert(*iter);
}
+#if 0
+ // Add elements it leads to, if they are dead ends. There is no reason not to hoist dead ends
+ // into loops, as it can avoid multiple entries after the loop
+ for (BlockBranchMap::iterator iter = Curr->BranchesOut.begin(); iter != Curr->BranchesOut.end(); iter++) {
+ Block *Target = iter->first;
+ if (Target->BranchesIn.size() <= 1 && Target->BranchesOut.size() == 0) {
+ Queue.insert(Target);
+ }
+ }
+#endif
}
}
assert(InnerBlocks.size() > 0);