Fix handling of CFG triangles in compute_postorder.

For example, in `loops_one`, ebb3 is the bottom of a triangle, so
postorder should order it after the rest of the triangle.
This commit is contained in:
Dan Gohman
2017-11-07 16:57:22 -08:00
parent 849f090562
commit 2b6502ac6e
3 changed files with 24 additions and 36 deletions

View File

@@ -51,7 +51,7 @@ fn simple_traversal() {
trap user0
}
",
vec![0, 1, 3, 2, 4, 5],
vec![0, 2, 5, 4, 1, 3],
);
}
@@ -71,7 +71,7 @@ fn loops_one() {
return
}
",
vec![0, 1, 3, 2],
vec![0, 1, 2, 3],
);
}
@@ -98,7 +98,7 @@ fn loops_two() {
return
}
",
vec![0, 1, 2, 4, 3, 5],
vec![0, 2, 1, 3, 4, 5],
);
}
@@ -130,7 +130,7 @@ fn loops_three() {
return
}
",
vec![0, 1, 2, 4, 3, 6, 7, 5],
vec![0, 2, 1, 3, 4, 6, 7, 5],
);
}