Skip to content

Commit 53a8347

Browse files
committed
Remove (unneeded) support for copy_value in initializer analysis
1 parent 6c66b8f commit 53a8347

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

lib/SIL/SILVerifier.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4733,12 +4733,6 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
47334733
if (term->isFunctionExiting()) {
47344734
require(state.Stack.empty(),
47354735
"return with stack allocs that haven't been deallocated");
4736-
if (!state.ActiveOps.empty()) {
4737-
for (auto *i : state.ActiveOps) {
4738-
i->dump();
4739-
}
4740-
}
4741-
47424736
require(state.ActiveOps.empty(),
47434737
"return with operations still active");
47444738

lib/SILOptimizer/IPO/LetPropertiesOpts.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,6 @@ LetPropertiesOpt::analyzeInitValue(SILInstruction *I, VarDecl *Property) {
400400
&& "Store instruction should store into a proper let property");
401401
(void) Dest;
402402
value = SI->getSrc();
403-
} else if (auto *copyValue = dyn_cast<CopyValueInst>(I)) {
404-
value = copyValue->getOperand();
405403
} else if (auto *copyAddr = dyn_cast<CopyAddrInst>(I)) {
406404
value = copyAddr->getSrc();
407405
}
@@ -524,7 +522,7 @@ void LetPropertiesOpt::collectPropertyAccess(SILInstruction *I,
524522

525523
if (isa<RefElementAddrInst>(I) || isa<StructElementAddrInst>(I)
526524
|| isa<BeginAccessInst>(I) || isa<CopyAddrInst>(I) ||
527-
isa<CopyValueInst>(I) || isa<BeginBorrowInst>(I)) {
525+
isa<BeginBorrowInst>(I)) {
528526
// Check if there is a store to this property.
529527
auto projection = cast<SingleValueInstruction>(I);
530528
for (auto Use : getNonDebugUses(projection)) {
@@ -546,14 +544,6 @@ void LetPropertiesOpt::collectPropertyAccess(SILInstruction *I,
546544
continue;
547545
}
548546

549-
if (auto *copyVal = dyn_cast<CopyValueInst>(User)) {
550-
if (copyVal != projection || !analyzeInitValue(copyVal, Property)) {
551-
SkipProcessing.insert(Property);
552-
return;
553-
}
554-
continue;
555-
}
556-
557547
if (auto *SI = dyn_cast<StoreInst>(User)) {
558548
// There is a store into this property.
559549
// Analyze the assigned value and check if it is a constant

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,9 +956,9 @@ class SILMem2Reg : public SILFunctionTransform {
956956
void run() override {
957957
SILFunction *F = getFunction();
958958

959-
// // FIXME: We should be able to support ownership.
960-
// if (F->hasOwnership())
961-
// return;
959+
// FIXME: We should be able to support ownership.
960+
if (F->hasOwnership())
961+
return;
962962

963963
LLVM_DEBUG(llvm::dbgs() << "** Mem2Reg on function: " << F->getName()
964964
<< " **\n");

0 commit comments

Comments
 (0)