Skip to content

Commit 42e4fbd

Browse files
committed
PassManager: fix a small bug with performance measurments
The check for invalidation was wrong, leading to not restore from the snapshot, which can result in wrong measurements.
1 parent 6a889c8 commit 42e4fbd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ void SILPassManager::runPassOnFunction(unsigned TransIdx, SILFunction *F) {
553553
// Run it!
554554
SFT->run();
555555

556-
if (changeNotifications != SILAnalysis::InvalidationKind::Nothing) {
556+
if (CurrentPassHasInvalidated ||
557+
changeNotifications != SILAnalysis::InvalidationKind::Nothing) {
557558
// Pause time measurement while invalidating analysis and restoring the snapshot.
558559
duration += (std::chrono::system_clock::now() - startTime);
559560

0 commit comments

Comments
 (0)