Add critical edge verification and fix SIL passes.

SIL passes were violating the existing invariant on non-cond-br
critical edges in several places. I fixed the places that I could
find.  Wherever there was a post-pass to "clean up" critical edges, I
replaced it with a a call to verification that the critical edges
aren't broken in the first place.

We still need to eliminate critical edges entirely before enabling
ownership SIL.
This commit is contained in:
Andrew Trick
2018-08-30 10:26:24 -07:00
parent 9d2af79975
commit 1e88e44ce8
15 changed files with 149 additions and 94 deletions

View File

@@ -2376,9 +2376,8 @@ class SwiftArrayOptPass : public SILFunctionTransform {
for (auto &HoistableLoopNest : HoistableLoopNests)
ArrayPropertiesSpecializer(DT, LA, HoistableLoopNest).run();
// We might have cloned there might be critical edges that need splitting.
splitAllCriticalEdges(*getFunction(), true /* only cond_br terminators*/,
DT, nullptr);
// Verify that no illegal critical edges were created.
getFunction()->verifyCriticalEdges();
LLVM_DEBUG(getFunction()->viewCFG());