Skip to content

Commit 571c8b5

Browse files
committed
[pass-manager] Add an option -sil-disable-skipping-passes that ensures that the bottom up pass manager never skips functions.
This ensures that when one is bisecting on pass counts, regardless of whether or not one removes code in the test case, the pass counts being run remain the same.
1 parent 7aaa565 commit 571c8b5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ llvm::cl::opt<bool> SILVerifyWithoutInvalidation(
9595
"sil-verify-without-invalidation", llvm::cl::init(false),
9696
llvm::cl::desc("Verify after passes even if the pass has not invalidated"));
9797

98+
llvm::cl::opt<bool> SILDisableSkippingPasses(
99+
"sil-disable-skipping-passes", llvm::cl::init(false),
100+
llvm::cl::desc("Do not skip passes even if nothing was changed"));
98101

99102
static llvm::ManagedStatic<std::vector<unsigned>> DebugPassNumbers;
100103

@@ -290,7 +293,8 @@ void SILPassManager::runPassesOnFunction(PassList FuncTransforms,
290293

291294
// If nothing changed since the last run of this pass, we can skip this
292295
// pass.
293-
if (completedPasses.test((size_t)SFT->getPassKind())) {
296+
if (completedPasses.test((size_t)SFT->getPassKind()) &&
297+
!SILDisableSkippingPasses) {
294298
if (SILPrintPassName)
295299
llvm::dbgs() << "(Skip) Stage: " << StageName
296300
<< " Pass: " << SFT->getName()

0 commit comments

Comments
 (0)