Recover FOR loops over a packed or zoned index #740

Manually merged
binjovi-bot merged 2 commits from lr1d into trunk 2026-11-06 19:42:34 +00:00
Owner

Recover FOR loops over a packed or zoned index

  • A for whose index is a packed or zoned field of scale 0 (for i = 1 to %elem(a), for i = 9 downto 1 by 2, a start in a field of the index's type) is a proved loop: the control statements are emitted. %ELEM(array) is named when the compiler wrote the limit before the sorted run of the source literals and the body indexes one array of that size.
  • The step is written last (downto 1 by 2), as RPG requires.
  • A zoned index of any digit count keeps the numeric type of its array (the 84 D 1 conversion was only read for four digits).
  • Probes lr1-lf-* (for-pk).

Gates

{"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"regenerated","emit":{"worse":[],"better":4,"newly_clean":20,"clean_delta":20,"base":394,"new":414},"twins":{"groups":586,"recovered":578,"regressions":[],"newly":16},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/lr1-di-pk3/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5-sub/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-zd4/stripped/object.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":811}}
# Recover FOR loops over a packed or zoned index - A `for` whose index is a packed or zoned field of scale 0 (`for i = 1 to %elem(a)`, `for i = 9 downto 1 by 2`, a start in a field of the index's type) is a proved loop: the control statements are emitted. `%ELEM(array)` is named when the compiler wrote the limit before the sorted run of the source literals and the body indexes one array of that size. - The step is written last (`downto 1 by 2`), as RPG requires. - A zoned index of any digit count keeps the numeric type of its array (the `84 D 1` conversion was only read for four digits). - Probes `lr1-lf-*` (for-pk). ## Gates ``` {"checks":{"net_statements":0},"census":{"statuses":{"recovered":645,"partial":0,"unresolved":0},"regressions":0,"newly_recovered":0},"golden":"golden floor 173 ceiling 0 <= dump 173/5/0","legend":"regenerated","emit":{"worse":[],"better":4,"newly_clean":20,"clean_delta":20,"base":394,"new":414},"twins":{"groups":586,"recovered":578,"regressions":[],"newly":16},"allgroups":{"regressions":[],"newly":["savf/SC-ILE/EXPERIMENTS/lr1-di-pk3/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5-sub/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-pk5/stripped/object.savf 2","savf/SC-ILE/EXPERIMENTS/lr1-di-zd4/stripped/object.savf 2"],"worse":[]},"full_check":{"exit":0,"seconds":811}} ```
Recover FOR loops over a packed or zoned index
All checks were successful
binjovi/ci Binjovi completed the frozen plan
858603f0c3
The decimal FOR recognizer proves the loop graph of a packed or zoned
index (to, by up, downto by), names %ELEM(array) for a limit the
compiler wrote before the literal run, writes the step last, and reads
the zoned index conversion for any digit count.
sean force-pushed lr1d from 858603f0c3
All checks were successful
binjovi/ci Binjovi completed the frozen plan
to e41c950e63
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-06 19:06:45 +00:00
Compare
sean force-pushed lr1d from e41c950e63
All checks were successful
binjovi/ci Binjovi completed the frozen plan
to fbd11bf50b
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-06 19:33:33 +00:00
Compare
binjovi-bot manually merged commit fbd11bf50b into trunk 2026-11-06 19:42:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/sourcerer!740
No description provided.