|
Jlm
|
Region-aware mod/ref summarizer. More...
#include <RegionAwareModRefSummarizer.hpp>


Classes | |
| struct | Context |
| class | Statistics |
| Region-aware mod/ref summarizer statistics. More... | |
Public Member Functions | |
| ~RegionAwareModRefSummarizer () noexcept override | |
| RegionAwareModRefSummarizer () | |
| RegionAwareModRefSummarizer (const RegionAwareModRefSummarizer &)=delete | |
| RegionAwareModRefSummarizer & | operator= (const RegionAwareModRefSummarizer &)=delete |
| std::unique_ptr< ModRefSummary > | SummarizeModRefs (const rvsdg::RvsdgModule &rvsdgModule, const PointsToGraph &pointsToGraph, util::StatisticsCollector &statisticsCollector) override |
Public Member Functions inherited from jlm::llvm::aa::ModRefSummarizer | |
| virtual | ~ModRefSummarizer () noexcept=default |
Static Public Member Functions | |
| static std::unique_ptr< ModRefSummary > | Create (const rvsdg::RvsdgModule &rvsdgModule, const PointsToGraph &pointsToGraph, util::StatisticsCollector &statisticsCollector) |
| static std::unique_ptr< ModRefSummary > | Create (const rvsdg::RvsdgModule &rvsdgModule, const PointsToGraph &pointsToGraph) |
Static Private Member Functions | |
| static util::HashSet< PointsToGraph::NodeIndex > | CreateSimpleAllocaSet (const PointsToGraph &pointsToGraph) |
| static std::string | CallGraphSCCsToString (const RegionAwareModRefSummarizer &summarizer) |
| static std::string | ToRegionTree (const rvsdg::Graph &rvsdg, const RegionAwareModRefSummary &modRefSummary) |
Private Attributes | |
| std::unique_ptr< RegionAwareModRefSummary > | ModRefSummary_ |
| std::unique_ptr< Context > | Context_ |
Region-aware mod/ref summarizer.
The key idea of the region-aware memory mod/ref summarizer is to only route memory locations into structural nodes if the memory is actually used within its regions. This ensures that no superfluous states will be routed through structural nodes and renders them independent if they do not reference the same memory location. The region-aware analysis proceeds as follows:
In a previous version of this class, alloca blocking was done based on SCCs in the call graph. Given a function call where the caller is in a different SCC than the callee, any alloca defined in the callee's SCC can be blocked from being propagated to the call. In practise, this blocking only helped to remove loads from a single file in the benchmarks.
Definition at line 63 of file RegionAwareModRefSummarizer.hpp.
|
overridedefaultnoexcept |
|
default |
|
delete |
|
private |
Defines a set of memory nodes to be blocked from the ModRefSet with the given index. A ModRefSet can have at most one such blocklist. The reference to the blocklist must stay valid until solving is finished.
Note: The blocklist only prevents propagation during solving, so the user must avoid adding blocked memory nodes manually.
Definition at line 1350 of file RegionAwareModRefSummarizer.cpp.
|
private |
Adds the fact that everything in the ModRefSet from should also be included in the ModRefSet to.
Definition at line 1340 of file RegionAwareModRefSummarizer.cpp.
|
private |
Helper function for filling ModRefSets based on the pointer being operated on
| modRefSetIndex | the index of the ModRefSet representing some memory operation |
| origin | the output producing the pointer value being operated on |
| minTargetSize | an optional size requirement for targeted memory locations |
| modRefEffect | the effect the operation may have on the memory targeted by origin |
Definition at line 1484 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1559 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1650 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1585 of file RegionAwareModRefSummarizer.cpp.
|
private |
Creates ModRefSets for regions and nodes within the function. The flow of MemoryNodes between sets is modeled by adding edges to the constraint graph.
Definition at line 1359 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1531 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1572 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1600 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1617 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1634 of file RegionAwareModRefSummarizer.cpp.
|
private |
Recursive call used to make the given region, its nodes and its subregions all be represented by the given ModRefSet.
| region | the region whose operations should be represented by the ModRefSet |
| modRefSet | the index of the ModRefSet used to represent the region |
| lambda | the function this region belongs to |
Definition at line 1382 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1428 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1545 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1405 of file RegionAwareModRefSummarizer.cpp.
|
staticprivate |
Helper function for debugging, listing out all functions, grouped by call graph SCC.
Definition at line 1933 of file RegionAwareModRefSummarizer.cpp.
|
static |
Creates a RegionAwareModRefSummarizer and calls the SummarizeModRefs() method.
| rvsdgModule | The RVSDG module for which the ModRefSummary should be computed. |
| pointsToGraph | The PointsToGraph corresponding to the RVSDG module. |
Definition at line 2015 of file RegionAwareModRefSummarizer.cpp.
|
static |
Creates a RegionAwareModRefSummarizer and calls the SummarizeModRefs() method.
| rvsdgModule | The RVSDG module for which the ModRefSummary should be computed. |
| pointsToGraph | The PointsToGraph corresponding to the RVSDG module. |
| statisticsCollector | The statistics collector for collecting pass statistics. |
Definition at line 2005 of file RegionAwareModRefSummarizer.cpp.
|
private |
Creates a call graph including all functions in the module, and groups all functions into SCCs. The resulting SCCs and topological order will be stored in the Context_ field.
| rvsdgModule | the module for which a mod/ref summary is computed. |
Definition at line 1025 of file RegionAwareModRefSummarizer.cpp.
|
private |
Creates subsets of the allocas defined in each region in the program, containing only the allocas that are determined to be non-reentrant. The requirements are:
Definition at line 1281 of file RegionAwareModRefSummarizer.cpp.
|
staticprivate |
Creates a set containing all simple Allocas is the PointsToGraph. An Alloca is simple if it is only reachable from other simple Allocas, or from RegisterNodes, in the PointsToGraph.
Definition at line 1167 of file RegionAwareModRefSummarizer.cpp.
|
private |
After solving, the ModRefSet representing all external functions is used to determine if any non-escaped variables in the module are only referenced, and never written to. These memory nodes can be considered constant, and should be omitted from all ModRefSets.
Definition at line 1769 of file RegionAwareModRefSummarizer.cpp.
|
private |
Gets the set of simple allocas that can be reached in the PointsToGraph, from the given set of nodes, by following points-to relations. The starting nodes must all be of register kind.
| nodes | the register nodes used as starting points for the reachability checks. |
Definition at line 1207 of file RegionAwareModRefSummarizer.cpp.
|
private |
Gets the set of simple alloca nodes that are reachable from the call's arguments. Reachability is defined in terms of the PointsToGraph.
| call | the call whose arguments are checked |
Definition at line 1252 of file RegionAwareModRefSummarizer.cpp.
|
private |
Gets the set of simple alloca nodes that are reachable from region's arguments. Reachability is defined in terms of the PointsToGraph.
| region | the region whose arguments are checked |
Definition at line 1233 of file RegionAwareModRefSummarizer.cpp.
|
private |
Uses the call graph to determine if the given function can ever be involved in a recursive chain of function calls.
| lambda | the function in question. |
Definition at line 1274 of file RegionAwareModRefSummarizer.cpp.
|
private |
Goes through the solved ModRefSet instances and materializes them. Also performs compression into the external memory node.
Definition at line 1797 of file RegionAwareModRefSummarizer.cpp.
|
private |
Materializes the ModRefSet instances in the given function, by explicitly adding memory nodes that are implicitly included in the set due to flags.
Also determines which memory nodes can be compressed into the external node in the function: memory nodes whose effects are always a subset of the effects on the external memory node, for every ModRefSet in the function.
| lambda | the function whose sets should be materialized. |
Definition at line 1809 of file RegionAwareModRefSummarizer.cpp.
|
delete |
|
private |
Uses the simple and complex constraints to propagate MemoryNodes between ModRefSets until all constraints are satisfied.
Definition at line 1700 of file RegionAwareModRefSummarizer.cpp.
|
overridevirtual |
Computes the memory nodes that are required at the entry and exit of a region, or at the entry/exit of a call node.
| rvsdgModule | The RVSDG module for which a ModRefSummary should be computed. |
| pointsToGraph | The points-to graph corresponding to rvsdgModule. |
| statisticsCollector | The statistics collector for collecting pass statistics. |
Implements jlm::llvm::aa::ModRefSummarizer.
Definition at line 914 of file RegionAwareModRefSummarizer.cpp.
|
staticprivate |
Converts rvsdg to an annotated region tree. This method is very useful for debugging the RegionAwareMemoryNodeProvider.
| rvsdg | The RVSDG that is converted to a region tree. |
| modRefSummary | The Mod/Ref summary used for annotating the region tree. |
Definition at line 1955 of file RegionAwareModRefSummarizer.cpp.
|
private |
For all ModRefSets where a blocklist is defined, checks that none of the MemoryNodes from the blocklist have been added to the ModRefSet.
Definition at line 1753 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 337 of file RegionAwareModRefSummarizer.hpp.
|
private |
The Mod/Ref summary produced by this summarizer
Definition at line 335 of file RegionAwareModRefSummarizer.hpp.