|
Jlm
|
Traces region reachability by predicate assertions. More...
#include <RegionPredicateTrace.hpp>
Classes | |
| class | Observer |
Public Member Functions | |
| ~RegionPredicateTrace () | |
| RegionPredicateTrace () | |
| PredicateValueRange | GetRegionPredicateAssignConstraints (Region ®ion, Input &predUse) |
| Computes value range for a predicate when exiting a region. | |
| PredicateSatRequired | GetRegionSatRequired (Region ®ion) |
| Computes required predicate assignments for region. | |
| bool | CheckPredicatesSatisfiable (Region &originRegion, Region &targetRegion) |
| Checks for dynamic reachability between two regions. | |
Private Types | |
| using | RegionPredRange = std::unordered_map< Region *, PredicateValueRange > |
Private Member Functions | |
| void | Clear () |
| void | ObserveRegion (Region ®ion) |
| const PredicateValueRange & | ComputeAndRecord (RegionPredRange ®ionPredRange, Input &input, std::unordered_map< Input *, PredicateValueRange > &visitedInputs, const ControlType &type) |
| PredicateValueRange | Compute (RegionPredRange ®ionPredRange, Input &input, std::unordered_map< Input *, PredicateValueRange > &visitedInputs, const ControlType &type) |
Private Attributes | |
| std::unordered_map< Input *, RegionPredRange > | predAssignment_ |
| std::unordered_map< Region *, PredicateSatRequired > | predSat_ |
| std::unordered_map< Region *, std::unique_ptr< Observer > > | observers_ |
Traces region reachability by predicate assertions.
Traces predicate def/use patterns in the graph and determines assignments of values to predicates in different regions, as well as the predicate assignments necessary to reach a given region.
Definition at line 104 of file RegionPredicateTrace.hpp.
|
private |
Definition at line 194 of file RegionPredicateTrace.hpp.
| jlm::rvsdg::RegionPredicateTrace::~RegionPredicateTrace | ( | ) |
Definition at line 73 of file RegionPredicateTrace.cpp.
| jlm::rvsdg::RegionPredicateTrace::RegionPredicateTrace | ( | ) |
Definition at line 76 of file RegionPredicateTrace.cpp.
| bool jlm::rvsdg::RegionPredicateTrace::CheckPredicatesSatisfiable | ( | Region & | originRegion, |
| Region & | targetRegion | ||
| ) |
Checks for dynamic reachability between two regions.
| originRegion | The "upper" region, from which we want to check whether another regino can be reached. |
| targetRegion | The "lower" region which we want to check whether it can be reached. |
targetRegion is dynamically reachable assuming that originRegion has been reached before.Computes predicates value ranges that are necessarily assigned assuming that originRegion has been entered, and checks whether these predicates allow targetRegion to be entered.
This allows to dynamically discriminate whether a value generated in originRegion can affect a use site in targetRegion:
originRegion may dynamically be forwarded and used in targetRegion originRegion cannot be the value ultimately used in targetRegion – the effective value at the use site within targetRegion must originate from somewhere else (effectively a gamma branch that is parallel to originRegion). Definition at line 315 of file RegionPredicateTrace.cpp.
|
private |
Definition at line 80 of file RegionPredicateTrace.cpp.
|
private |
Helper function for the above ComputeAndRecord
Definition at line 145 of file RegionPredicateTrace.cpp.
|
private |
Traces from the given input to find the regions that may provide its value.
| regionPredRange | the resulting map of possible values provided in each region. |
| input | the input being traced from |
| visitedInputs | set of seen inputs, to avoid re-visiting |
| type | the type of the input |
Definition at line 108 of file RegionPredicateTrace.cpp.
| PredicateValueRange jlm::rvsdg::RegionPredicateTrace::GetRegionPredicateAssignConstraints | ( | Region & | region, |
| Input & | predUse | ||
| ) |
Computes value range for a predicate when exiting a region.
| region | Region to check at exit |
| predUse | Use site of the predicate of interest |
Traces the definitions of the predicate used at preUse back to its definition sites. Computes the possible values that the predicate can obtain from its definition sites at the end of the region queried.
For example, if a constant value is assigned to a predicate within this region, then this will determine its value range. If OTOH there are multiple alternative paths within or leading into this region with multiple possible predicate assignments, then this will report the union of all possible values.
Definition at line 255 of file RegionPredicateTrace.cpp.
| PredicateSatRequired jlm::rvsdg::RegionPredicateTrace::GetRegionSatRequired | ( | Region & | region | ) |
Computes required predicate assignments for region.
| region | The region that we want to check for reachability |
Computes which predicate needs to be assigned which value in order to reach a specific region. E.g. for a region nested inside three gamma nodes, this gives the required assignments to the three control predicates in question that are needed in order to reach the inner region.
Definition at line 283 of file RegionPredicateTrace.cpp.
Definition at line 97 of file RegionPredicateTrace.cpp.
|
private |
Definition at line 235 of file RegionPredicateTrace.hpp.
|
private |
Definition at line 229 of file RegionPredicateTrace.hpp.
|
private |
Definition at line 232 of file RegionPredicateTrace.hpp.