Repository navigation
dasLLVM tests: the loop-lookup count starts at the loop header - #4479
Conversation
The count skipped only `.preheader` blocks, so a hoisted lookup in a run-once block the x86 vectorizer adds before the loop (`iter.check`) counted as inside it and the nightly linux lane failed. A lookup counts from the first loop header on: daslang's `for_start`/`while_start` or the vectorizer's `vector.ph`/`vector.body`, preheaders excluded. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟢 Approval recommended
The update refines the regression test’s loop-header detection to avoid false failures from pre-loop blocks, and the only reviewer feedback is a non-blocking suggestion about naming/exit handling rather than an unresolved issue.
No open issues 🎉
What changed in this PR
This pull request updates the dasLLVM JIT IR-parsing regression test so that “lookups inside a loop” are counted starting from the first detected loop-header basic block (daslang loop headers or LLVM vectorizer loop headers), while excluding preheaders. This prevents false failures when LLVM introduces run-once pre-loop blocks (e.g., iter.check) that may contain hoisted lookups.
Changes:
- Add
is_loop_headerto recognize loop-header block labels (and exclude.preheaderblocks). - Update
lookups_inside_loopto begin counting only after the first detected loop header, rather than treating most non-preheader blocks as “in-loop”. - Update/clarify the helper behavior to match the new counting boundary.
Reviewer note (moderate): lookups_inside_loop now effectively counts lookups in every block after the first loop header because in_loop never resets, which can mislead (name/expectations) and may count post-loop blocks; consider renaming to match semantics or adding loop-exit detection to make it strictly loop-body-only.
| File | Summary |
|---|---|
modules/dasLLVM/tests/llvm_jit_global_lookup.das |
Refines IR block classification so loop-lookup counting starts at the first real loop header and ignores run-once pre-loop blocks (fixing the nightly false-positive). |
This pull request requires changes.
Review effort: Balanced
Why. The nightly linux lane failed
llvm_jit_global_lookup.dason #4475: the hoisted lookups sat initer.check, a run-once block the x86 vectorizer adds before the loop, and the test counted every block but the entry and.preheaderones as "inside the loop".What changes.
for_start/while_startor the vectorizer'svector.ph/vector.body, a preheader of either excluded - instead of from any block that is not a preheader.Observable behavior.
a lookup under a branch in a loop leaves the loopon the linux nightly lane:expected: 0, got: 2-> passes with the same IR.speculatabledropped fromjit_get_global_mnhthe cell still fails (got: 2), so the test keeps catching an un-hoisted lookup.Where to look.
is_loop_headerandlookups_inside_loopinmodules/dasLLVM/tests/llvm_jit_global_lookup.das.Validation, claims, ledger
Validation
extended_checks (linux, all)on goto: a labelled block resolves only its own labels; a computed goto checks its target #4475, run 42370157567) puts both lookups initer.check, beforevector.main.loop.iter.checkandvector.ph, which the new rule reads as run-once.Not done
#nightly - the lane that runs this test is nightly.