-
-
Notifications
You must be signed in to change notification settings - Fork 161
fix(harness): a quoted LLVM label must start a new basic block (#9494) #9510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+98
−6
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| - **`compiler-output-regression`: a quoted LLVM label now starts a new basic block.** | ||
| `native-region-proof` failed `packed_f64_loop_versioning` with | ||
| `hot_loops_no_runtime_calls: {"for.packed_f64_fast.body.54.i.epil": ["js_array_alloc"]}` | ||
| on correct codegen. The named block holds no calls at all — it is a clean | ||
| scalar epilogue; the `js_array_alloc` belongs to the following block, which | ||
| builds `console.log`'s argument array. | ||
|
|
||
| The block splitter matched labels with `^([A-Za-z0-9_.$-]+):(?:\s|$)`. LLVM | ||
| quotes any identifier outside its bare-name set, and #9337's specialized | ||
| functions carry a `$`, so the next label is emitted as | ||
| `"perry_fn_…$spec_i32.exit":`. That line starts with `"`, so it never matched: | ||
| no new block began and the quoted block's body was appended to the preceding | ||
| label, moving a call into an unrolled hot-loop epilogue. The mis-attribution | ||
| can only ever move calls *into* the preceding block, which is exactly the | ||
| false-positive shape observed. | ||
|
|
||
| `extract_blocks` / `extract_blocks_with_functions` now accept optionally-quoted | ||
| labels and quoted `define` names. Verified against the exact IR CI analyzed | ||
| (run 33598905771): 510 → 512 blocks, hot-loop count unchanged at 29, subject's | ||
| hot-loop runtime calls `{"…epil": ["js_array_alloc"]}` → `{}`. Sweeping every | ||
| workload in that artifact, `packed_f64_loop_versioning` is the only verdict | ||
| that moves, so no masked failure is exposed. The regression test is | ||
| sabotage-checked: reverting the pattern fails 2 of its 3 cases. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Please address both gaps in the function-aware parsing path. The greedy
.*@match can consume an@inside a quoted LLVM function name such as@\"a@foo(\", causingcurrent_functionto be recorded incorrectly and potentially misattributing named regions; use a grammar-aware function-name parse. Also add a regression case throughextract_blocks_with_functionsthat verifies a quoted label such asfn$spec_i32.exitbecomes a separate block undermain, since the current quoted-label tests exerciseextract_blocksonly.📍 Affects 2 files
scripts/compiler_output_harness/analyzers.py#L81-L81(this comment)tests/test_compiler_output_regression.py#L3049-L3061🤖 Prompt for AI Agents
Source: MCP tools