File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ llvm::cl::opt<bool> DisableConvertEscapeToNoEscapeSwitchEnumPeephole(
41
41
" Disable the convert_escape_to_noescape switch enum peephole. " ),
42
42
llvm::cl::Hidden);
43
43
44
+ llvm::cl::opt<bool > DisableCopyEliminationOfCopyableCapture (
45
+ " sil-disable-copy-elimination-of-copyable-closure-capture" ,
46
+ llvm::cl::init (false ),
47
+ llvm::cl::desc(" Don't eliminate copy_addr of Copyable closure captures "
48
+ " inserted by SILGen" ));
49
+
44
50
using namespace swift ;
45
51
46
52
// / Given an optional diamond, return the bottom of the diamond.
@@ -761,6 +767,13 @@ static SILValue tryRewriteToPartialApplyStack(
761
767
continue ;
762
768
}
763
769
770
+ if (DisableCopyEliminationOfCopyableCapture) {
771
+ if (!copy->getType ().isMoveOnly ()) {
772
+ LLVM_DEBUG (llvm::dbgs () << " -- not move-only\n " );
773
+ continue ;
774
+ }
775
+ }
776
+
764
777
// Is the capture a borrow?
765
778
766
779
auto paramIndex = i + appliedArgStartIdx;
Original file line number Diff line number Diff line change 1
- // RUN: %target-sil-opt -enable-sil-verify-all -closure-lifetime-fixup -emit-verbose-sil %s | %FileCheck %s
1
+ // RUN: %target-sil-opt -enable-sil-verify-all -closure-lifetime-fixup -emit-verbose-sil -sil-disable-copy-elimination-of-copyable-closure-capture=true %s | %FileCheck %s
2
2
3
3
import Builtin
4
4
import Swift
You can’t perform that action at this time.
0 commit comments