This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Give precedence to first AddressMap entries
ClosedPublic

Authored by rafauler on Aug 23 2023, 5:12 PM.

Details

Summary

When parsing AddressMap and there is a conflict in keys,
where two entries share the same key, consider the first entry as the
correct one, instead of the last. This matches previous behavior in
BOLT and covers case such as BOLT creating a new basic block but
sharing the same input offset of the previous (or entry) basic
block. In this case, instead of translating debuginfo to use the newly
created BB, translate using the BB that was originally read from
input. This will increase our chances of getting debuginfo right.

Tested via binary comparison in tests:
X86/dwarf4-df-input-lowpc-ranges.test
X86/dwarf5-df-input-lowpc-ranges.test

Diff Detail

Event Timeline

rafauler created this revision.Aug 23 2023, 5:12 PM
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
rafauler requested review of this revision.Aug 23 2023, 5:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2023, 5:12 PM
This revision is now accepted and ready to land.Aug 24 2023, 12:41 AM
maksfb accepted this revision.Aug 24 2023, 9:26 AM
This revision was automatically updated to reflect the committed changes.