File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
lib/SILOptimizer/SILCombiner Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -1961,7 +1961,7 @@ SILInstruction *SILCombiner::visitMarkDependenceInst(MarkDependenceInst *mdi) {
1961
1961
// does not have a meaning, so just eliminate it.
1962
1962
{
1963
1963
SILType baseType = mdi->getBase ()->getType ();
1964
- if (baseType.isObject () && baseType .isTrivial (*mdi->getFunction ())) {
1964
+ if (baseType.getObjectType () .isTrivial (*mdi->getFunction ())) {
1965
1965
SILValue value = mdi->getValue ();
1966
1966
mdi->replaceAllUsesWith (value);
1967
1967
return eraseInstFromFunction (*mdi);
Original file line number Diff line number Diff line change @@ -3785,6 +3785,22 @@ bb0(%0 : $B):
3785
3785
return %2 : $B
3786
3786
}
3787
3787
3788
+ // CHECK-LABEL: sil @mark_dependence_trivial_address_base :
3789
+ // CHECK: bb0(
3790
+ // CHECK-NEXT: strong_retain
3791
+ // CHECK-NEXT: alloc_stack $Int
3792
+ // CHECK-NEXT: dealloc_stack
3793
+ // CHECK-NEXT: return
3794
+ // CHECK: } // end sil function 'mark_dependence_trivial_address_base'
3795
+ sil @mark_dependence_trivial_address_base : $@convention(thin) (@guaranteed B) -> @owned B {
3796
+ bb0(%0 : $B):
3797
+ strong_retain %0 : $B
3798
+ %1 = alloc_stack $Int
3799
+ %2 = mark_dependence %0 : $B on %1 : $*Int
3800
+ dealloc_stack %1 : $*Int
3801
+ return %2 : $B
3802
+ }
3803
+
3788
3804
protocol _NSArrayCore {}
3789
3805
3790
3806
// CHECK-LABEL: sil @mark_dependence_base2
You can’t perform that action at this time.
0 commit comments