6#ifndef JLM_RVSDG_REGIONPREDICATETRACE_HPP
7#define JLM_RVSDG_REGIONPREDICATETRACE_HPP
14#include <unordered_map>
62 auto size = std::min(
values_.size(),
other.values_.size());
63 for (std::size_t
n = 0;
n < size; ++
n)
80 :
values_(nalternatives, init_value)
215 std::unordered_map<Input *, PredicateValueRange> &
visitedInputs,
225 std::unordered_map<Input *, PredicateValueRange> &
visitedInputs,
233 std::unordered_map<Region *, PredicateSatRequired>
predSat_;
236 std::unordered_map<Region *, std::unique_ptr<Observer>>
observers_;
324 std::pair<Output *, size_t>,
325 std::vector<Region *>,
class providing guarantees about unreachability of regions from other regions.
bool markRequiredPredicateValueInternal(Output &output, size_t value, std::vector< Region * > &impossibleOrigins)
AlternativeRegionPredicateTracer()
bool markRequiredPredicateValue(Output &output, size_t value, std::vector< Region * > &impossibleOrigins)
std::unordered_map< std::pair< Output *, size_t >, std::vector< Region * >, util::Hash< std::pair< Output *, size_t > > > impossibleOriginRegions_
std::unordered_map< Output *, PredicateValueRange > predicateValueRanges_
PredicateValueRange getPossibleValuesInternal(Output &output)
bool canCurrentOriginSatisfyRequirement(Output &output, size_t value)
bool isReachableFromRegion(Region &targetRegion, Region &originRegion)
PredicateValueRange & getPossibleValues(Output &output)
util::HashSet< Region * > currentOriginRegionAncestors_
size_t nalternatives() const noexcept
size_t nalternatives() const noexcept
size_t alternative() const noexcept
Value range for a predicate.
std::vector< bool > values_
bool AllowsValue(std::size_t alternative) const noexcept
Checks whether value range allows a specific value.
static PredicateValueRange CreateEmpty(const ControlType &type)
Constructs empty value range (unsatisfiable predicate range).
void UpdateUnion(const PredicateValueRange &other)
Takes union of two value ranges.
PredicateValueRange(std::size_t nalternatives, bool init_value)
static PredicateValueRange CreateSingleValue(const ControlValueRepresentation &value)
Definite value range (exactly one value possible).
static PredicateValueRange CreateUnknown(const ControlType &type)
Constructs full value range (every value possible).
Traces region reachability by predicate assertions.
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.
std::unordered_map< Region *, PredicateSatRequired > predSat_
bool CheckPredicatesSatisfiable(Region &originRegion, Region &targetRegion)
Checks for dynamic reachability between two regions.
void ObserveRegion(Region ®ion)
PredicateValueRange Compute(RegionPredRange ®ionPredRange, Input &input, std::unordered_map< Input *, PredicateValueRange > &visitedInputs, const ControlType &type)
const PredicateValueRange & ComputeAndRecord(RegionPredRange ®ionPredRange, Input &input, std::unordered_map< Input *, PredicateValueRange > &visitedInputs, const ControlType &type)
std::unordered_map< Region *, PredicateValueRange > RegionPredRange
std::unordered_map< Input *, RegionPredRange > predAssignment_
std::unordered_map< Region *, std::unique_ptr< Observer > > observers_
Represent acyclic RVSDG subgraphs.
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
std::vector< std::pair< Input *, std::size_t > > PredicateSatRequired
Describes which predicates need to be satisfied.