Function sequant::eval::detail::slicing_instance

Function Documentation

inline std::optional<LoopKey> sequant::eval::detail::slicing_instance(RichSchedule const &rich, std::size_t vid, std::size_t p, container::svector<std::pair<LoopKey, int>> const &path, container::svector<std::wstring> const &path_spaces)

The loop instance among path (with its axis spaces) that slices carried position p of value vid: an enclosing entry whose index space is the position’s own and whose slot is the fusion slot any occurrence of the value records for that position. Every occurrence is tested, not just the production one, because that is the runtime’s own test: a value CSE-shared by several consumers is sliced on this loop if any of its occurrences was bound to that slot, and the first occurrence is not privileged.

Note

The match is on (space, slot), and so relies on fusion never giving two levels of the same space one slot &#8212; were that to happen, a position could match the wrong level of its own space. Outermost enclosing entry wins (path is outermost-first).