Files
swift-mirror/lib/SILOptimizer/Mandatory/RegionAnalysisInvalidationTransform.cpp
Michael Gottesman e29e035ab8 [region-analysis] Add a pass that explicitly invalidates RegionAnalysis.
Over time I am going to be using RegionAnalysis for a series of passes that all
use that same information since I am worried about RegionAnalysis computation
time. With that being said, we want to make sure to eliminate the memory that
RegionAnalysis uses once this series of passes have completed. What this commit
does is create a pass that explicitly invalidates region analysis and explicitly
places it in the pass pipeline after the series of passes. This will ensure that
even if we add an additional pass, there is a strong "rattlesnake" signal to the
new code author that the code needs to be placed before the region analysis
invalidation and will prevent mistakes such as having to recompute the region
analysis in that later pass or the later pass forgeting to invalidate the
analysis.
2024-02-09 11:59:04 -08:00

21 lines
805 B
C++

//===--- RegionAnalysisInvalidationTransform.cpp --------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#include "swift/SILOptimizer/Analysis/RegionAnalysis.h"
#include "swift/SILOptimizer/Transforms/AnalysisInvalidationTransform.h"
using namespace swift;
SILTransform *swift::createRegionAnalysisInvalidationTransform() {
return new AnalysisInvalidationTransform<RegionAnalysis>();
}