Skip to content

Commit

Permalink
Merge pull request swiftlang#30104 from gottesmm/pr-cc29e3d175061f19a…
Browse files Browse the repository at this point in the history
…6d6a201fa78c513d626a498
  • Loading branch information
swift-ci authored Feb 27, 2020
2 parents a5241ed + a45c51e commit 6b1af59
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/SILOptimizer/Transforms/SemanticARCOpts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/CommandLine.h"

using namespace swift;

Expand Down Expand Up @@ -457,6 +458,10 @@ struct SemanticARCOptVisitor

} // end anonymous namespace

static llvm::cl::opt<bool>
VerifyAfterTransform("sil-semantic-arc-opts-verify-after-transform",
llvm::cl::init(false), llvm::cl::Hidden);

bool SemanticARCOptVisitor::processWorklist() {
// NOTE: The madeChange here is not strictly necessary since we only have
// items added to the worklist today if we have already made /some/ sort of
Expand Down Expand Up @@ -492,14 +497,21 @@ bool SemanticARCOptVisitor::processWorklist() {
deleteAllDebugUses(defInst);
eraseInstruction(defInst);
madeChange = true;
if (VerifyAfterTransform) {
F.verify();
}
continue;
}
}

// Otherwise, if we have a single value instruction (to be expanded later
// perhaps), try to visit that value recursively.
if (auto *svi = dyn_cast<SingleValueInstruction>(next)) {
madeChange |= visit(svi);
bool madeSingleChange = visit(svi);
madeChange |= madeSingleChange;
if (VerifyAfterTransform && madeSingleChange) {
F.verify();
}
continue;
}
}
Expand Down

0 comments on commit 6b1af59

Please sign in to comment.