This is an archive of the discontinued LLVM Phabricator instance.

[JITLink][RISCV] Adjust offsets of non-relaxable edges
ClosedPublic

Authored by jobnoorman on Jun 22 2023, 3:15 AM.

Details

Summary

The relaxation algorithm used to only update offsets of relaxable edges.
This caused non-relaxable edges that appear after a relaxed instruction
to have an incorrect offset and be applied at the wrong location. This
patch fixes this by updating the offsets of all edges.

Note that this bug was caused by an incorrect translation of LLD's
relaxation algorithm. LLD always uses all edges during relaxation while
I decided to filter-out relaxable edges to prevent having to iterate
non-relaxable edges at each step. However, this had the side-effect of
only updating offsets of relaxable edges. This patch leaves the
filtering of relaxable edges as-is but iterates all edges when updating
offsets.

Diff Detail

Event Timeline

jobnoorman created this revision.Jun 22 2023, 3:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2023, 3:15 AM
Herald added subscribers: asb, luke, pmatos and 28 others. · View Herald Transcript
jobnoorman requested review of this revision.Jun 22 2023, 3:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2023, 3:15 AM
This revision is now accepted and ready to land.Jun 25 2023, 10:01 PM
This revision was landed with ongoing or failed builds.Jun 26 2023, 12:45 AM
This revision was automatically updated to reflect the committed changes.