Fix loop merge and continue as same block (#485)
Fixes #482
* New pass fixes up after structurize cfg
* splits blocks that are both a loop merge block and a loop continue
block
* updated simple tests to reorder check statements
* replaced hack-scf tests with specific pass tests on IR that check all
comparisons
* pass tests
diff --git a/lib/Compiler.cpp b/lib/Compiler.cpp
index 905b7d1..6b5cf80 100644
--- a/lib/Compiler.cpp
+++ b/lib/Compiler.cpp
@@ -696,6 +696,8 @@
pm->add(clspv::createUndoTruncatedSwitchConditionPass());
pm->add(llvm::createStructurizeCFGPass(false));
// Must be run after structurize cfg.
+ pm->add(clspv::createFixupStructuredCFGPass());
+ // Must be run after structured cfg fixup.
pm->add(clspv::createReorderBasicBlocksPass());
pm->add(clspv::createUndoGetElementPtrConstantExprPass());
pm->add(clspv::createSplatArgPass());