File tree Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -1066,6 +1066,22 @@ bool SimplifyCFG::tryJumpThreading(BranchInst *BI) {
1066
1066
return true ;
1067
1067
}
1068
1068
1069
+ namespace swift ::test {
1070
+ // / Arguments:
1071
+ // / - BranchInst - the branch whose destination might be merged into its parent
1072
+ // / Dumps:
1073
+ // / - nothing
1074
+ static FunctionTest SimplifyCFGTryJumpThreading (
1075
+ " simplify-cfg-try-jump-threading" ,
1076
+ [](auto &function, auto &arguments, auto &test) {
1077
+ auto *passToRun = cast<SILFunctionTransform>(createSimplifyCFG ());
1078
+ passToRun->injectPassManager (test.getPassManager ());
1079
+ passToRun->injectFunction (&function);
1080
+ SimplifyCFG (function, *passToRun, /* VerifyAll=*/ false ,
1081
+ /* EnableJumpThread=*/ false )
1082
+ .tryJumpThreading (cast<BranchInst>(arguments.takeInstruction ()));
1083
+ });
1084
+ } // end namespace swift::test
1069
1085
1070
1086
// / simplifyBranchOperands - Simplify operands of branches, since it can
1071
1087
// / result in exposing opportunities for CFG simplification.
Original file line number Diff line number Diff line change @@ -311,21 +311,6 @@ static FunctionTest FieldSensitiveMultiDefUseLiveRangeTest(
311
311
boundary.print (llvm::errs ());
312
312
});
313
313
314
- // ===----------------------------------------------------------------------===//
315
- // MARK: SimplifyCFG Unit Tests
316
- // ===----------------------------------------------------------------------===//
317
-
318
- static FunctionTest SimplifyCFGTryJumpThreading (
319
- " simplify-cfg-try-jump-threading" ,
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
- .tryJumpThreading (cast<BranchInst>(arguments.takeInstruction ()));
327
- });
328
-
329
314
// ===----------------------------------------------------------------------===//
330
315
// MARK: AccessPath Unit Tests
331
316
// ===----------------------------------------------------------------------===//
You can’t perform that action at this time.
0 commit comments