Repository navigation
JIT: normalize loop-cloning offset ADD types - #133765
Merged
Merged
Conversation
|
Azure Pipelines: 16 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
Co-authored-by: EgorBo <[email protected]>
Copilot
AI
changed the title
[WIP] Fix loop cloning bug for ushort limit base
JIT: normalize loop-cloning offset ADD types
Sep 11, 2026
EgorBo
marked this pull request as ready for review
September 11, 2026 23:59
EgorBo
approved these changes
Sep 11, 2026
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
All reviewed changes are covered by the final assessment and no blocking issues remain.
Pull request overview
Fixes invalid small-typed ADD nodes generated by loop cloning for ushort limits.
Changes:
- Normalize variable-offset additions with
genActualType. - Add
ushortboundary and short-array regression coverage.
File summaries
| File | Description |
|---|---|
src/tests/JIT/opt/Cloning/OffsetLimit.cs |
Adds ushort limits, boundary cases, and exception tests. |
src/coreclr/jit/loopcloning.cpp |
Corrects the generated offset ADD type. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
Member
|
PTAL @AndyAyersMS missing genActualType, not sure if it could lead to real issues, but at least fixes the assert. |
AndyAyersMS
approved these changes
Sep 14, 2026
Member
|
/ba-g knwon mono failures |
EgorBo
enabled auto-merge (squash)
September 14, 2026 23:35
jtschuster
pushed a commit
to jtschuster/runtime
that referenced
this pull request
Sep 18, 2026
<!-- --> Loop cloning emits an invalid `ADD ushort` for limits such as `ushort n + 1000`, triggering “Unexpected small type in IR.” - **IR:** Use `genActualType(node)` for the variable-offset `ADD`, preserving the local’s precise type. - **Coverage:** Extend `OffsetLimit` with the reported `65000 + 1000` case, `ushort` boundaries, and short arrays that must still throw. <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes dotnet#133761 --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: EgorBo <[email protected]>
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Loop cloning emits an invalid
ADD ushortfor limits such asushort n + 1000, triggering “Unexpected small type in IR.”genActualType(node)for the variable-offsetADD, preserving the local’s precise type.OffsetLimitwith the reported65000 + 1000case,ushortboundaries, and short arrays that must still throw.GT_ADDfor aushortlimit base with a constant offset #133761