6#ifndef JLM_RVSDG_REGIONPREDICATETRACE_HPP
7#define JLM_RVSDG_REGIONPREDICATETRACE_HPP
13#include <unordered_map>
61 auto size = std::min(
values_.size(),
other.values_.size());
62 for (std::size_t
n = 0;
n < size; ++
n)
79 :
values_(nalternatives, init_value)
214 std::unordered_map<Input *, PredicateValueRange> &
visitedInputs,
224 std::unordered_map<Input *, PredicateValueRange> &
visitedInputs,
232 std::unordered_map<Region *, PredicateSatRequired>
predSat_;
235 std::unordered_map<Region *, std::unique_ptr<Observer>>
observers_;
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.