You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(ssa): drop the dead Shape.Host field and move OverflowsI64 to LICM - #346
Delete ssa.Shape.Host: never set outside format_test.go, only printed.
Move ssa.OverflowsI64 (one caller, transform/licm.gohoistable) into LICM as private overflows.
Replace TestOverflowsI64 with a LICM contract case: a loop-invariant i64.add stays in the loop. Mutation-checked: removing the overflows test from hoistable turns it red.
First of five structural cleanups from a review of the bytecode → SSA → optimize → native pipeline.
Loop optimizations now keep certain arithmetic operations inside the loop when moving them could change their behavior. This helps preserve correct results for values that exceed the supported numeric range.
Refactor
Updated internal handling of shape formatting and arithmetic checks. These changes do not alter the remaining shape details or the formatted output for them.
…o LICM
Shape.Host was never set outside a format test; it only reached the
printer. OverflowsI64 is an opcode fact with one caller, LICM's hoistable,
so it becomes LICM's private overflows. Its contract is now pinned at the
public boundary: LICM keeps a loop-invariant i64.add in the loop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This repository does not receive automatic reviews because it has fewer than 10 stars.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 5a12644a-5b02-402e-a982-a137f36d502e
No actionable comments were generated in the recent review.
Walkthrough
The changes remove host-kind metadata from SSA shapes and their formatted output. LICM now uses a local helper to classify overflow-capable opcodes, and a regression test checks that it does not hoist a potentially overflowing loop-invariant I64_ADD.
Shape no longer has a Host field, and shape formatting no longer prints a host value. The struct-shape test no longer sets or expects Host.
LICM Overflow Checks
Layer / File(s)
Summary
Local overflow classification and LICM regression internal/transform/licm.go, internal/transform/licm_test.go, internal/ssa/operation.go, internal/ssa/operation_test.go
LICM uses a local overflows helper to classify arithmetic and shift opcodes. The exported ssa.OverflowsI64 helper and its test are removed. A regression test checks that a potentially overflowing invariant I64_ADD stays in the loop body and that the transformed function verifies.
This is a structural cleanup. It removes unused shape metadata and keeps the loop optimizer's overflow-aware hoisting behavior, now covered by a regression test. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the two main changes: removing the unused Shape.Host field and moving OverflowsI64 into LICM. It follows conventional commit style and matches the changeset. It is specific enough for …
Description check
The description covers the changes made (removing Shape.Host, moving OverflowsI64 into LICM as overflows, replacing TestOverflowsI64 with a LICM regression case) and the test plan with checks run. It …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the two main changes: removing the unused Shape.Host field and moving OverflowsI64 into LICM. It follows conventional commit style and matches the changeset. It is specific enough for a reader scanning history.
Full details: Description check
Explanation
The description covers the changes made (removing Shape.Host, moving OverflowsI64 into LICM as overflows, replacing TestOverflowsI64 with a LICM regression case) and the test plan with checks run. It does not use the template's section headings (Changes Made, Related Issues, Additional Information). Related Issues is missing, and Additional Information is only partly covered by the note about the five-part cleanup series.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 20ff5dd0-f8a0-40c2-9b5f-da66db0cd7a9
Commits
Reviewing files that changed from the base of the PR and between af86a70 and 4d26392.
Files selected for processing: 6
internal/ssa/format.go
internal/ssa/format_test.go
internal/ssa/operation.go
internal/ssa/operation_test.go
internal/transform/licm.go
internal/transform/licm_test.go
Files with no reviewable changes: 3
internal/ssa/format.go
internal/ssa/operation.go
internal/ssa/operation_test.go
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Summary
ssa.Shape.Host: never set outsideformat_test.go, only printed.ssa.OverflowsI64(one caller,transform/licm.gohoistable) into LICM as privateoverflows.TestOverflowsI64with a LICM contract case: a loop-invarianti64.addstays in the loop. Mutation-checked: removing theoverflowstest fromhoistableturns it red.First of five structural cleanups from a review of the bytecode → SSA → optimize → native pipeline.
Test plan
go test ./internal/ssa ./internal/transformmake checkgit diff --check🤖 Generated with Claude Code
Summary by CodeRabbit