struct CGSCCUpdateResult
Declaration
struct CGSCCUpdateResult { /* full declaration omitted */ };
Description
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager infrsatructure. The CGSCC pass manager runs SCC passes which are allowed to update the call graph and SCC structures. This means the structure the pass manager works on is mutating underneath it. In order to support that, there needs to be careful communication about the precise nature and ramifications of these updates to the pass management infrastructure. All SCC passes will have to accept a reference to the management layer's update result struct and use it to reflect the results of any CG updates performed. Passes which do not change the call graph structure in any way can just ignore this argument to their run method.
Declared at: llvm/include/llvm/Analysis/CGSCCPassManager.h:232
Member Variables
- public SmallPriorityWorklist<LazyCallGraph::RefSCC*, 1>& RCWorklist
- This worklist is in reverse post-order, as we pop off the back in order to observe RefSCCs in post-order. When adding RefSCCs, clients should add them in reverse post-order.
- public SmallPriorityWorklist<LazyCallGraph::SCC*, 1>& CWorklist
- This worklist is in reverse post-order, as we pop off the back in order to observe SCCs in post-order. When adding SCCs, clients should add them in reverse post-order.
- public SmallPtrSetImpl<LazyCallGraph::RefSCC*>& InvalidatedRefSCCs
- This is used to quickly prune out RefSCCs when they get deleted and happen to already be on the worklist. We use this primarily to avoid scanning the list and removing entries from it.
- public SmallPtrSetImpl<LazyCallGraph::SCC*>& InvalidatedSCCs
- This is used to quickly prune out SCCs when they get deleted and happen to already be on the worklist. We use this primarily to avoid scanning the list and removing entries from it.
- public LazyCallGraph::RefSCC* UpdatedRC
- This is set when a graph refinement takes place an the "current" point in the graph moves "down" or earlier in the post-order walk. This will often cause the "current" RefSCC to be a newly created RefSCC object and the old one to be added to the above worklist. When that happens, this pointer is non-null and can be used to continue processing the "top" of the post-order walk.
- public LazyCallGraph::SCC* UpdatedC
- This is set when a graph refinement takes place an the "current" point in the graph moves "down" or earlier in the post-order walk. This will often cause the "current" SCC to be a newly created SCC object and the old one to be added to the above worklist. When that happens, this pointer is non-null and can be used to continue processing the "top" of the post-order walk.
- public llvm::PreservedAnalyses CrossSCCPA
- We specifically want to allow CGSCC passes to mutate ancestor IR (changing both the CG structure and the function IR itself). However, this means we need to take special care to correctly mark what analyses are preserved *across* SCCs. We have to track this out-of-band here because within the main `PassManeger` infrastructure we need to mark everything within an SCC as preserved in order to avoid repeatedly invalidating the same analyses as we unnest pass managers and adaptors. So we track the cross-SCC version of the preserved analyses here from any code that does direct invalidation of SCC analyses, and then use it whenever we move forward in the post-order walk of SCCs before running passes over the new SCC.
- public SmallDenseSet<std::pair<LazyCallGraph::Node*, LazyCallGraph::SCC*>, 4>& InlinedInternalEdges
- FIXME: Keeping this here seems like a big layering issue, we should look for a better technique.