Skip to content

Commit f92b75c

Browse files
committed
[sil-combine] Enable unchecked_trivial_bitcast for ownership.
Instruction just deals with trivial values.
1 parent 2ff6fdf commit f92b75c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

lib/SILOptimizer/SILCombiner/SILCombinerCastVisitors.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,9 +664,6 @@ visitRawPointerToRefInst(RawPointerToRefInst *RawToRef) {
664664
SILInstruction *
665665
SILCombiner::
666666
visitUncheckedTrivialBitCastInst(UncheckedTrivialBitCastInst *UTBCI) {
667-
if (UTBCI->getFunction()->hasOwnership())
668-
return nullptr;
669-
670667
// (unchecked_trivial_bit_cast Y->Z
671668
// (unchecked_trivial_bit_cast X->Y x))
672669
// ->

test/SILOptimizer/sil_combine_ossa.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,8 +1996,8 @@ bb0(%0 : @owned $Builtin.NativeObject, %1 : $Builtin.RawPointer):
19961996
// CHECK-LABEL: sil [ossa] @bitcast_combines : $@convention(thin) (@owned Builtin.NativeObject, Builtin.RawPointer) -> @owned (B, Optional<Builtin.Word>) {
19971997
// CHECK: unchecked_ref_cast
19981998
// CHECK-NOT: unchecked_bit_cast
1999-
// XHECK: unchecked_trivial_bit_cast
2000-
// XHECK-NOT: unchecked_trivial_bit_cast
1999+
// CHECK: unchecked_trivial_bit_cast
2000+
// CHECK-NOT: unchecked_trivial_bit_cast
20012001
// CHECK: } // end sil function 'bitcast_combines'
20022002
sil [ossa] @bitcast_combines : $@convention(thin) (@owned Builtin.NativeObject, Builtin.RawPointer) -> @owned (B, Optional<Builtin.Word>) {
20032003
bb0(%0 : @owned $Builtin.NativeObject, %1 : $Builtin.RawPointer):

0 commit comments

Comments
 (0)