Relaxation improvements - #1802
Open
Shankar Easwaran (quic-seaswara) wants to merge 2 commits into
Open
Conversation
Shankar Easwaran (quic-seaswara)
requested a review
from Shakti Suman (quic-shaksuma)
as a code owner
September 1, 2026 16:52
Shankar Easwaran (quic-seaswara)
requested review from
Parth (parth-07)
and removed request for
Shakti Suman (quic-shaksuma)
September 1, 2026 16:52
Shankar Easwaran (quic-seaswara)
marked this pull request as draft
September 1, 2026 16:52
Shankar Easwaran (quic-seaswara)
requested review from
Sam Elliott (lenary) and
Sudharsan Veeravalli (svs-quic)
September 1, 2026 16:53
Shankar Easwaran (quic-seaswara)
force-pushed
the
relaxation_improvements
branch
from
September 1, 2026 16:54
294fbd4 to
55e1739
Compare
Contributor
Author
|
|
Shankar Easwaran (quic-seaswara)
marked this pull request as ready for review
September 2, 2026 03:41
Parth (parth-07)
force-pushed
the
relaxation_improvements
branch
from
September 2, 2026 10:25
55e1739 to
8ca0188
Compare
Parth (parth-07)
requested changes
Sep 3, 2026
Shankar Easwaran (quic-seaswara)
force-pushed
the
relaxation_improvements
branch
2 times, most recently
from
September 8, 2026 22:04
4593fbc to
712433b
Compare
Relaxation decisions made in an earlier pass (AUIPC+JALR -> JAL/C.J, HI20+LO12 -> GP-relative) can be invalidated by a later pass shrinking a section further (notably R_RISCV_ALIGN), producing an encoding that can no longer reach its target with no diagnostic. Instead of applying each relaxation to the fragment buffer and the relocation as soon as it's decided, record it per-fragment and apply the whole set once relaxation has settled. Nothing is written until then, so a decision that turns out not to fit can simply be dropped -- there is nothing to restore, since nothing was ever applied. Committing a fragment's pending edits in one pass rewrites or deletes instruction bytes and keeps the relocation's cached encoding in sync, fixes up relocation and symbol offsets/sizes using the cumulative effect of every edit, compacts the buffer, and applies any deferred relocation type/addend changes. A settle step runs once the main relaxation loop exits, and repeats until stable, recomputing program headers between rounds. It re-verifies every deferred call and GP-relative relaxation against final addresses, rolls back any that no longer fit, and re-decides alignment padding before committing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Shankar Easwaran <seaswara@qti.qualcomm.com>
Shankar Easwaran (quic-seaswara)
force-pushed
the
relaxation_improvements
branch
from
September 8, 2026 22:17
712433b to
16a1d68
Compare
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.
No description provided.