Skip to content

Commit 8f9c533

Browse files
authored
Merge pull request #60306 from eeckstein/fix-performance-measurement
PassManager: fix a small bug with performance measurments
2 parents 0c48517 + a30a4ad commit 8f9c533

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/SILOptimizer/PassManager/PassManager.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,14 +553,15 @@ 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

560561
if (runIdx < numRepeats - 1) {
561562
invalidateAnalysis(F, SILAnalysis::InvalidationKind::Everything);
562563
F->restoreFromSnapshot(SnapshotID);
563-
} else {
564+
} else if (changeNotifications != SILAnalysis::InvalidationKind::Nothing) {
564565
invalidateAnalysis(F, changeNotifications);
565566
}
566567
changeNotifications = SILAnalysis::InvalidationKind::Nothing;

0 commit comments

Comments
 (0)