Skip to content

dasLLVM tests: the loop-lookup count starts at the loop header - #4479

Merged
borisbat merged 1 commit into
masterfrom
bbatkin/jit-loop-lookup-test
Nov 7, 2026
Merged

borisbat merged 1 commit into
masterfrom
bbatkin/jit-loop-lookup-test

Conversation

@borisbat

@borisbat borisbat commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Why. The nightly linux lane failed llvm_jit_global_lookup.das on #4475: the hoisted lookups sat in iter.check, a run-once block the x86 vectorizer adds before the loop, and the test counted every block but the entry and .preheader ones as "inside the loop".

What changes.

  • A lookup counts as inside the loop from the first loop header on - daslang's for_start/while_start or the vectorizer's vector.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 loop on the linux nightly lane: expected: 0, got: 2 -> passes with the same IR.
  • With speculatable dropped from jit_get_global_mnh the cell still fails (got: 2), so the test keeps catching an un-hoisted lookup.

Where to look. is_loop_header and lookups_inside_loop in modules/dasLLVM/tests/llvm_jit_global_lookup.das.

Validation, claims, ledger

Validation

Not done

  • The test still reads block layout from the dump text; a lookup hoisted into a block after the loop would count, and no fixture produces one.

#nightly - the lane that runs this test is nightly.

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>
Copilot AI balanced review requested due to automatic review settings November 7, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_header to recognize loop-header block labels (and exclude .preheader blocks).
  • Update lookups_inside_loop to 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

@borisbat
borisbat merged commit 856daf4 into master Nov 7, 2026
64 checks passed
@borisbat
borisbat deleted the bbatkin/jit-loop-lookup-test branch November 7, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants