Template Function sequant::eval::build_value_node_map¶
Defined in File value_node_map.hpp
Function Documentation¶
-
template<meta::eval_node_range R>
ValueNodeMap<std::ranges::range_value_t<R>> sequant::eval::build_value_node_map(R const &forest)¶ The value_id -> forest-node bridge (design integration point 1).
A schedule addresses a value by its
ValueCell::value_id(e.g.BuildStep::value_id); the value’s eval node is recovered through theValueCell::hashthat cell carries — exactly theEvalExpr::hash_value()identityCacheManagerdedups by. This maps every distinct forest node by that hash, so avalue_idresolves asmap[rich.cells[value_id].hash]. Under perfect CSE many occurrences share one hash; a single representative node (the first visited) is kept, which is all a homed value needs (every occurrence is the same value). Pure lookup construction — no execution.Note
Lives in its own header so that
ordered_executor.hpp— which needs this bridge to resolve aBuildStep::value_idto a forest node — can use it without depending on an executor header.- Returns:
A
ValueNodeMappointing intoforest— see its warning; the result must not outliveforest.