Skip to content

Commit 341facf

Browse files
committed
Replace some instances of check isTrivial with check OwnershipKind::None
1 parent 9ef7b2a commit 341facf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/SILOptimizer/Transforms/DeadCodeElimination.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ bool DCE::removeDead(SILFunction &F) {
524524

525525
arg->replaceAllUsesWithUndef();
526526

527-
if (!F.hasOwnership() || arg->getType().isTrivial(F)) {
527+
if (!F.hasOwnership() || arg->getOwnershipKind() == OwnershipKind::None) {
528528
i++;
529529
Changed = true;
530530
BranchesChanged = true;

lib/SILOptimizer/Utils/InstOptUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,7 @@ SILValue swift::makeCopiedValueAvailable(
19971997
if (!value->getFunction()->hasOwnership())
19981998
return value;
19991999

2000-
if (value->getType().isTrivial(*value->getFunction()))
2000+
if (value.getOwnershipKind() == OwnershipKind::None)
20012001
return value;
20022002

20032003
auto insertPt = getInsertAfterPoint(value).getValue();
@@ -2013,7 +2013,7 @@ SILValue swift::makeNewValueAvailable(
20132013
if (!value->getFunction()->hasOwnership())
20142014
return value;
20152015

2016-
if (value->getType().isTrivial(*value->getFunction()))
2016+
if (value.getOwnershipKind() == OwnershipKind::None)
20172017
return value;
20182018

20192019
assert(value->getUses().empty() &&

0 commit comments

Comments
 (0)