[IPSCCP] Decouple queries for function analysis results.
The SCCPSolver is using a structure (AnalysisResultsForFn) where it keeps pointers to various analyses needed by the IPSCCP pass. These analyses are requested all at the same time, which can become problematic in some cases. For example one could be retrieved via getCachedAnalysis() prior to the actual execution of the analysis. In more detail: The IPSCCP pass uses a DomTreeUpdater to preserve the PostDominatorTree in case the PostDominatorTreeAnalysis had run before IPSCCP. Starting with commit 1b123204 the IPSCCP pass may use BlockFrequencyAnalysis for some functions in the module. As a result, the PostDominatorTreeAnalysis may not run until the BlockFrequencyAnalysis has run, since the latter analysis depends on the former. Currently, we setup the DomTreeUpdater using getCachedAnalysis to retrieve a PostDominatorTree. This happens before BlockFrequencyAnalysis has run, therefore the cached analysis can become invalid by the time we use it. Differential Revision: https://reviews.llvm.org/D151666
parent
b7052fa3
Please register or sign in to comment