Skip to content

Commit dff8550

Browse files
committed
SILCombine: fix a wrong assert in the SingleBlockOwnedForwardingInstFolder
1 parent f7f5f9a commit dff8550

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/SILOptimizer/SILCombiner/SILCombinerCastVisitors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class SingleBlockOwnedForwardingInstFolder {
145145
if (!hasOneNonDebugUse(next))
146146
return false;
147147

148-
assert(rest.empty() || getSingleNonDebugUser(rest.back()) == next);
148+
assert(rest.empty() || getSingleNonDebugUser(next) == rest.back());
149149
rest.push_back(next);
150150
return true;
151151
}

test/SILOptimizer/sil_combine_ossa.sil

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5486,3 +5486,15 @@ bb0(%0 : @owned $Cr):
54865486
return %8
54875487
}
54885488

5489+
// CHECK-LABEL: sil [ossa] @init_existential_with_debug_value :
5490+
// CHECK: return %0
5491+
// CHECK: } // end sil function 'init_existential_with_debug_value'
5492+
sil [ossa] @init_existential_with_debug_value : $@convention(thin) (@owned Cr) -> @owned Cr {
5493+
bb0(%1 : @owned $Cr):
5494+
%5 = init_existential_ref %1 : $Cr : $Cr, $any Pr
5495+
debug_value %5, let, name "interactor", argno 2
5496+
%48 = open_existential_ref %5 to $@opened("F9D78C78-0FCD-11F0-9F91-0EA13E3AABB1", any Pr) Self
5497+
%49 = unchecked_ref_cast %48 to $Cr
5498+
return %49
5499+
}
5500+

0 commit comments

Comments
 (0)