Skip to content

Commit 46dbf8e

Browse files
committed
Cleanup SILCombine hasValueDeinit checks
1 parent af1d0d4 commit 46dbf8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ static bool isValueTrivial(SILValue value, SILFunction *function) {
832832
continue;
833833

834834
// MoveOnly types may have a user-defined deinit.
835-
if (v->getType().isPureMoveOnly())
835+
if (hasValueDeinit(v))
836836
return false;
837837

838838
if (isa<StructInst>(v) || isa<TupleInst>(v)) {
@@ -870,7 +870,7 @@ SILInstruction *SILCombiner::visitReleaseValueInst(ReleaseValueInst *RVI) {
870870

871871
// retain_value of an enum_inst where we know that it has a payload can be
872872
// reduced to a retain_value on the payload.
873-
if (EI->hasOperand() && !hasValueDeinit(EI)) {
873+
if (EI->hasOperand()) {
874874
return Builder.createReleaseValue(RVI->getLoc(), EI->getOperand(),
875875
RVI->getAtomicity());
876876
}

0 commit comments

Comments
 (0)