|
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 | 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 57 of file RegionAwareModRefSummarizer.hpp.
|
overridedefaultnoexcept |
|
default |
|
delete |
|
private |
Defines a set of simple alloca memory nodes that are allowed to be added to the ModRefSet with the given index. When an allowlist is specified, all other simple allocas are blocked from being added.
Note: The allowlist only prevents propagation during solving, so the user must avoid adding simple alloca memory nodes manually.
Definition at line 1050 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 1040 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 1197 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1272 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1363 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1298 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 1078 of file RegionAwareModRefSummarizer.cpp.
|
private |
Recursively traverses the given region to find and annotate all contained lambda nodes.
| region | the interprocedural region to annotate |
Definition at line 1060 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1244 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1285 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1313 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1330 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1347 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 1102 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1141 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1258 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 1125 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 1711 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 1701 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 922 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 1490 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 962 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 1007 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 988 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 1518 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 1527 of file RegionAwareModRefSummarizer.cpp.
|
delete |
|
private |
Disqualifies allocas from being regarded as simple if they are reachable from the arguments of functions that call setjmp.
Definition at line 1029 of file RegionAwareModRefSummarizer.cpp.
|
private |
Uses the simple and complex constraints to propagate MemoryNodes between ModRefSets until all constraints are satisfied.
Definition at line 1418 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 859 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 1651 of file RegionAwareModRefSummarizer.cpp.
|
private |
For all ModRefSets where a simple alloca allowlist is defined, checks that no other simple allocas outside of the list are included.
Definition at line 1474 of file RegionAwareModRefSummarizer.cpp.
|
private |
Definition at line 307 of file RegionAwareModRefSummarizer.hpp.
|
private |
The Mod/Ref summary produced by this summarizer
Definition at line 305 of file RegionAwareModRefSummarizer.hpp.