Repository navigation
[Mono][AMD64] Fix code generation for oversized add immediates. - #134933
Merged
lateralusX merged 1 commit intoOct 1, 2026
Merged
Conversation
Value-type load/store decomposition can introduce address additions whose constants exceed the signed 32-bit immediate range. Materialize these constants with OP_I8CONST and use OP_LADD before peephole optimization and register allocation. This avoids the MiniFullAOT emitter assertion and prevents the JIT peephole pass from encoding a truncated LEA displacement. Encodable add immediates remain unchanged. Fixes dotnet#134301 Validated Linux x64 Release Mono, full-AOT compilation of Regression_ro_2 and dependencies, and Runtime_133785 under default JIT, JIT without peephole optimization, and full-AOT execution.
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 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: @steveisok, @vitek-karas |
This was
linked to
issues
Sep 30, 2026
Closed
Member
Author
steveisok
approved these changes
Oct 1, 2026
This was referenced Oct 3, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix Mono AMD64 code generation for address additions whose constants exceed the signed 32-bit immediate range.
Value-type load/store decomposition can introduce these additions when accessing array elements at large constant indices. Previously, they could:
ADD.LEAwith a truncated displacement.Materialize oversized constants with
OP_I8CONSTand use register-registerOP_LADDduring lowering, before peephole optimization and register allocation. Additions with encodable immediates remain unchanged.The existing
Runtime_133785test exposed this pre-existing defect. No tests are disabled.Fixes #134301
Fixes #134651
Fixes #134692
Fixes #134832