@@ -165,10 +165,8 @@ bool RedundantPhiEliminationPass::optimizeArgs(SILBasicBlock *block) {
165
165
// arg.
166
166
if (phi1->getOwnershipKind () == OwnershipKind::Owned &&
167
167
phi2->getOwnershipKind () == OwnershipKind::Owned) {
168
- #ifndef NDEBUG
169
168
assert (hasOnlyNoneOwnershipIncomingValues (phi1));
170
169
assert (hasOnlyNoneOwnershipIncomingValues (phi2));
171
- #endif
172
170
SILBuilderWithScope builder (&block->front ());
173
171
auto copy = builder.createCopyValue (
174
172
RegularLocation::getAutoGeneratedLocation (), phi1);
@@ -178,18 +176,14 @@ bool RedundantPhiEliminationPass::optimizeArgs(SILBasicBlock *block) {
178
176
// If arg2 has none ownership, replace arg1 with arg2
179
177
else if (phi1->getOwnershipKind () == OwnershipKind::Owned &&
180
178
phi2->getOwnershipKind () == OwnershipKind::None) {
181
- #ifndef NDEBUG
182
179
assert (hasOnlyNoneOwnershipIncomingValues (phi1));
183
- #endif
184
180
phi1->replaceAllUsesWith (phi2);
185
181
eraseOwnedPhiArgument (block, arg1Idx);
186
182
}
187
183
// If arg1 has none ownership, replace arg2 with arg1
188
184
else if (phi1->getOwnershipKind () == OwnershipKind::None &&
189
185
phi2->getOwnershipKind () == OwnershipKind::Owned) {
190
- #ifndef NDEBUG
191
186
assert (hasOnlyNoneOwnershipIncomingValues (phi2));
192
- #endif
193
187
phi2->replaceAllUsesWith (phi1);
194
188
eraseOwnedPhiArgument (block, arg2Idx);
195
189
} else {
0 commit comments