File tree Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Expand file tree Collapse file tree 2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -2619,6 +2619,23 @@ bool SimplifyCFG::simplifyTermWithIdenticalDestBlocks(SILBasicBlock *BB) {
2619
2619
return true ;
2620
2620
}
2621
2621
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
+
2622
2639
// / Checks if the block contains a cond_fail as first side-effect instruction
2623
2640
// / and tries to move it to the predecessors (if beneficial). A sequence
2624
2641
// /
Original file line number Diff line number Diff line change @@ -315,17 +315,6 @@ static FunctionTest FieldSensitiveMultiDefUseLiveRangeTest(
315
315
// MARK: SimplifyCFG Unit Tests
316
316
// ===----------------------------------------------------------------------===//
317
317
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
-
329
318
static FunctionTest SimplifyCFGTryJumpThreading (
330
319
" simplify-cfg-try-jump-threading" ,
331
320
[](auto &function, auto &arguments, auto &test) {
You can’t perform that action at this time.
0 commit comments