Skip to content

Commit aaaf5a4

Browse files
authored
Merge pull request swiftlang#78260 from meg-gupta/enableedgecase
Allow SimplifyCFG::simplifyArgument on borrowed values
2 parents 636525e + 3637316 commit aaaf5a4

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/SILOptimizer/Transforms/SimplifyCFG.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3730,8 +3730,6 @@ bool SimplifyCFG::simplifyArgument(SILBasicBlock *BB, unsigned i) {
37303730
}
37313731
if (inst->getOwnershipKind() == OwnershipKind::Owned)
37323732
return !inst->getSingleUse();
3733-
if (BorrowedValue borrow = BorrowedValue(inst->getOperand(0)))
3734-
return borrow.isLocalScope();
37353733
return false;
37363734
};
37373735

test/SILOptimizer/simplify_cfg_ossa_bbargs.sil

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ bb3:
266266
}
267267

268268
// CHECK-LABEL: sil [ossa] @test_simplify_enum_arg_guaranteed1 :
269-
// CHECK: bb1([[ARG:%.*]] : @guaranteed $FakeOptional<Klass>)
269+
// CHECK: bb1([[ARG:%.*]] : @guaranteed $Klass)
270270
// CHECK-LABEL: } // end sil function 'test_simplify_enum_arg_guaranteed1'
271271
sil [ossa] @test_simplify_enum_arg_guaranteed1 : $@convention(thin) (@owned Klass) -> () {
272272
bb0(%0 : @owned $Klass):
@@ -290,7 +290,9 @@ bb2:
290290
return %t : $()
291291
}
292292

293-
// CHECK: bb1([[ARG:%.*]] : @guaranteed $NonTrivialStruct)
293+
// CHECK-LABEL: sil [ossa] @test_simplify_enum_arg_guaranteed2 :
294+
// CHECK: bb1([[ARG:%.*]] : @guaranteed $Klass)
295+
// CHECK-LABEL: } // end sil function 'test_simplify_enum_arg_guaranteed2'
294296
sil [ossa] @test_simplify_enum_arg_guaranteed2 : $@convention(thin) (@owned Klass) -> () {
295297
bb0(%0 : @owned $Klass):
296298
specify_test "simplify_cfg_simplify_argument @block[1] 0"

utils/build-presets.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,8 @@ skip-build-tvos
14541454
skip-test-tvos
14551455
skip-build-watchos
14561456
skip-test-watchos
1457+
skip-build-xros
1458+
skip-test-xros
14571459

14581460
[preset: buildbot_osx_package]
14591461
mixin-preset=

0 commit comments

Comments
 (0)