Skip to content

Commit f1d61af

Browse files
committed
[Test] Ensourced simplify-cfg-simplify....
-term-with-identical-dest-blocks. Moved the test next to the code it calls.
1 parent 736b1af commit f1d61af

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

lib/SILOptimizer/Transforms/SimplifyCFG.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,6 +2619,23 @@ bool SimplifyCFG::simplifyTermWithIdenticalDestBlocks(SILBasicBlock *BB) {
26192619
return true;
26202620
}
26212621

2622+
namespace swift::test {
2623+
/// Arguments:
2624+
/// - SILBasicBlock - the block whose terminator's destinations are all the same
2625+
/// Dumps:
2626+
/// - nothing
2627+
static FunctionTest SimplifyCFGSimplifyTermWithIdenticalDestBlocks(
2628+
"simplify-cfg-simplify-term-with-identical-dest-blocks",
2629+
[](auto &function, auto &arguments, auto &test) {
2630+
auto *passToRun = cast<SILFunctionTransform>(createSimplifyCFG());
2631+
passToRun->injectPassManager(test.getPassManager());
2632+
passToRun->injectFunction(&function);
2633+
SimplifyCFG(function, *passToRun, /*VerifyAll=*/false,
2634+
/*EnableJumpThread=*/false)
2635+
.simplifyTermWithIdenticalDestBlocks(arguments.takeBlock());
2636+
});
2637+
} // end namespace swift::test
2638+
26222639
/// Checks if the block contains a cond_fail as first side-effect instruction
26232640
/// and tries to move it to the predecessors (if beneficial). A sequence
26242641
///

lib/SILOptimizer/UtilityPasses/TestRunner.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,6 @@ static FunctionTest FieldSensitiveMultiDefUseLiveRangeTest(
315315
// MARK: SimplifyCFG Unit Tests
316316
//===----------------------------------------------------------------------===//
317317

318-
static FunctionTest SimplifyCFGSimplifyTermWithIdenticalDestBlocks(
319-
"simplify-cfg-simplify-term-with-identical-dest-blocks",
320-
[](auto &function, auto &arguments, auto &test) {
321-
auto *passToRun = cast<SILFunctionTransform>(createSimplifyCFG());
322-
passToRun->injectPassManager(test.getPassManager());
323-
passToRun->injectFunction(&function);
324-
SimplifyCFG(function, *passToRun, /*VerifyAll=*/false,
325-
/*EnableJumpThread=*/false)
326-
.simplifyTermWithIdenticalDestBlocks(arguments.takeBlock());
327-
});
328-
329318
static FunctionTest SimplifyCFGTryJumpThreading(
330319
"simplify-cfg-try-jump-threading",
331320
[](auto &function, auto &arguments, auto &test) {

0 commit comments

Comments
 (0)