summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-10-07 23:50:52 -0600
committerTuowen Zhao <ztuowen@gmail.com>2016-10-07 23:50:52 -0600
commit9cf3d7b307d1dc810fa205bcfa8470cee7c7541e (patch)
tree61cd37d774c4007f20d850064bba65b8748ae8e5
parent7bbd1a207f65428283471f1cc956f3fda43fbe3e (diff)
downloadchill-9cf3d7b307d1dc810fa205bcfa8470cee7c7541e.tar.gz
chill-9cf3d7b307d1dc810fa205bcfa8470cee7c7541e.tar.bz2
chill-9cf3d7b307d1dc810fa205bcfa8470cee7c7541e.zip
fix
-rw-r--r--src/transformations/loop.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/transformations/loop.cc b/src/transformations/loop.cc
index 0b9603e..026794f 100644
--- a/src/transformations/loop.cc
+++ b/src/transformations/loop.cc
@@ -1349,10 +1349,8 @@ std::vector<std::set<int> > Loop::sort_by_same_loops(std::set<int> active,
//while (itn->content->type() != IR_CONTROL_LOOP && itn != NULL)
// itn = itn->parent;
- while ((itn != NULL) && (itn->payload != level - 1)) {
+ while ((itn != NULL) && ((itn->payload != level - 1) || itn -> content->type() != IR_CONTROL_LOOP)) {
itn = itn->parent;
- while (itn != NULL && itn->content->type() != IR_CONTROL_LOOP)
- itn = itn->parent;
}
if (itn == NULL)