loki.transformations.single_column.vertical_utils
Shared utility functions for vertical loop transformations.
This module provides the building blocks used by
SCCVerticalKCaching
to merge vertical loops, convert array dependencies to scalar carry
variables, and demote KLEV-dimensioned temporaries.
The utilities are grouped as follows:
- Loop inspection
_collect_vertical_loops(),_loop_upper_bound_expr(),_loop_upper_bound_str(),_loop_is_backward(),_loop_effective_bounds(),_is_klev_plus_n(),_extract_plus_n().- Carry conversion (Phase 1c)
_convert_all_carries(),_build_carry_expr_entries(),_build_save_assignment().- Init-expression substitution (Phase 1d)
_substitute_init_expressions_all_loops(),_build_init_subst_map(),_apply_subst_outside_loops().- Dead-loop / zero-init elimination (Phases 1b, 1e)
_find_dead_loops_all(),_remove_whole_array_zero_inits(),_find_zero_inits_outside_loops().- Loop merging (Phase 2)
_merge_vertical_loops(),_build_bounds_guard(),_relocate_interloop_code().- Post-merge fixup (Phases 2b, 2c)
_cross_loop_carry_substitution(),_insert_writebacks_for_argument_carries(),_hoist_rotates_to_end().- Demotion helpers (Phase 3)
_find_demotable_arrays(),_collect_call_arg_names(),_collect_refs_outside_loops().- Cleanup (Phase 4)
_remove_self_assignments(),_remove_dead_carry_originals().- Shared infrastructure
_SkipNodesVisitor,_EarlyTermination,_make_zero_literal(),_is_zero_literal(),_is_jk_eq_1(),_collect_loop_node_set().