Jlm
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
jlm::rvsdg::AlternativeRegionPredicateTracer Class Referencefinal

class providing guarantees about unreachability of regions from other regions. More...

#include <RegionPredicateTrace.hpp>

Collaboration diagram for jlm::rvsdg::AlternativeRegionPredicateTracer:
Collaboration graph
[legend]

Public Member Functions

 AlternativeRegionPredicateTracer ()
 
bool isReachableFromRegion (Region &targetRegion, Region &originRegion)
 
void clearCaches ()
 

Private Member Functions

PredicateValueRange & getPossibleValues (Output &output)
 
PredicateValueRange getPossibleValuesInternal (Output &output)
 
bool markRequiredPredicateValue (Output &output, size_t value, std::vector< Region * > &impossibleOrigins)
 
bool markRequiredPredicateValueInternal (Output &output, size_t value, std::vector< Region * > &impossibleOrigins)
 
bool canCurrentOriginSatisfyRequirement (Output &output, size_t value)
 

Private Attributes

std::unordered_map< Output *, PredicateValueRange > predicateValueRanges_
 
std::unordered_map< std::pair< Output *, size_t >, std::vector< Region * >, util::Hash< std::pair< Output *, size_t > > > impossibleOriginRegions_
 
util::HashSet< Region * > currentOriginRegionAncestors_
 

Detailed Description

class providing guarantees about unreachability of regions from other regions.

If any control type edges are modified, or if any regions are deleted, during the lifetime of the tracer, the tracer's caches must be cleared manually.

See also
clearCaches()

Definition at line 246 of file RegionPredicateTrace.hpp.

Constructor & Destructor Documentation

◆ AlternativeRegionPredicateTracer()

jlm::rvsdg::AlternativeRegionPredicateTracer::AlternativeRegionPredicateTracer ( )
default

Member Function Documentation

◆ canCurrentOriginSatisfyRequirement()

bool jlm::rvsdg::AlternativeRegionPredicateTracer::canCurrentOriginSatisfyRequirement ( Output &  output,
size_t  value 
)
private

Checks if the current origin region or any of its ancestors are unable to satisfy the requirement that the given output gets the given value. If the (output, value) pair has not yet been processed, it is processed first via markRequiredPredicateValue.

Parameters
outputan output of type ControlType
valuethe value the output must have in order to reach/leave the target region.
Returns
false if the origin region or one of its ancestors are unable to meet the requirement

Definition at line 474 of file RegionPredicateTrace.cpp.

◆ clearCaches()

void jlm::rvsdg::AlternativeRegionPredicateTracer::clearCaches ( )

Removes all cached information from the tracer. This must be done if edges or constants of ControlType have been modified in a way that changes the static reachability guarantees between regions. Also, if regions get removed from the graph, the caches must be cleared to prevent new regions re-useing the address from causing cache collisions.

Definition at line 566 of file RegionPredicateTrace.cpp.

◆ getPossibleValues()

PredicateValueRange & jlm::rvsdg::AlternativeRegionPredicateTracer::getPossibleValues ( rvsdg::Output &  output)
private

Determines the set of possible values for the given output.

Parameters
outputthe output in question, must be of type ControlType.
Returns
the possible values of the control type output.

Definition at line 346 of file RegionPredicateTrace.cpp.

◆ getPossibleValuesInternal()

PredicateValueRange jlm::rvsdg::AlternativeRegionPredicateTracer::getPossibleValuesInternal ( rvsdg::Output &  output)
private

Definition at line 361 of file RegionPredicateTrace.cpp.

◆ isReachableFromRegion()

bool jlm::rvsdg::AlternativeRegionPredicateTracer::isReachableFromRegion ( Region &  targetRegion,
Region &  originRegion 
)

Determines if it is possible for control flow to go from the given originRegion to the given targetRegion, without following any back-edges in any theta node that contains the originRegion. No assumptions are made about theta nodes surrounding the targetRegion, or control flow entering theta nodes between the two regions.

Definition at line 499 of file RegionPredicateTrace.cpp.

◆ markRequiredPredicateValue()

bool jlm::rvsdg::AlternativeRegionPredicateTracer::markRequiredPredicateValue ( Output &  output,
size_t  value,
std::vector< Region * > &  impossibleOrigins 
)
private

Processes the fact that a given output needs to have a specific value, and adds all origin regions that are unable to satisfy the requirement to a list. Assumes no back-edges are taken around the considered origin regions.

Parameters
outputan output of type ControlType
valuethe value the output must have in order to reach/leave the target region.
impossibleOriginsa list to which all impossible origin regions are added.
Returns
false if the output can never satisfy the requirement

Definition at line 403 of file RegionPredicateTrace.cpp.

◆ markRequiredPredicateValueInternal()

bool jlm::rvsdg::AlternativeRegionPredicateTracer::markRequiredPredicateValueInternal ( rvsdg::Output &  output,
size_t  value,
std::vector< Region * > &  impossibleOrigins 
)
private

Definition at line 426 of file RegionPredicateTrace.cpp.

Member Data Documentation

◆ currentOriginRegionAncestors_

util::HashSet<Region *> jlm::rvsdg::AlternativeRegionPredicateTracer::currentOriginRegionAncestors_
private

Definition at line 331 of file RegionPredicateTrace.hpp.

◆ impossibleOriginRegions_

std::unordered_map< std::pair<Output *, size_t>, std::vector<Region *>, util::Hash<std::pair<Output *, size_t> > > jlm::rvsdg::AlternativeRegionPredicateTracer::impossibleOriginRegions_
private

Definition at line 327 of file RegionPredicateTrace.hpp.

◆ predicateValueRanges_

std::unordered_map<Output *, PredicateValueRange> jlm::rvsdg::AlternativeRegionPredicateTracer::predicateValueRanges_
private

Definition at line 319 of file RegionPredicateTrace.hpp.


The documentation for this class was generated from the following files: