We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a45b5f commit c46acc0Copy full SHA for c46acc0
lib/SILOptimizer/Transforms/SimplifyCFG.cpp
@@ -1032,6 +1032,13 @@ bool SimplifyCFG::tryJumpThreading(BranchInst *BI) {
1032
auto *DestBB = BI->getDestBB();
1033
auto *SrcBB = BI->getParent();
1034
TermInst *destTerminator = DestBB->getTerminator();
1035
+ if (Fn.hasOwnership()) {
1036
+ if (llvm::any_of(DestBB->getArguments(), [this](SILValue op) {
1037
+ return !op->getType().isTrivial(Fn);
1038
+ })) {
1039
+ return false;
1040
+ }
1041
1042
// If the destination block ends with a return, we don't want to duplicate it.
1043
// We want to maintain the canonical form of a single return where possible.
1044
if (destTerminator->isFunctionExiting())
0 commit comments