This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Use opcode name in hashBlock
ClosedPublic

Authored by Amir on May 5 2023, 3:37 PM.

Details

Reviewers
rafauler
maksfb
Group Reviewers
Restricted Project
Commits
rG6fcb91b2f756: [BOLT] Use opcode name in hashBlock
Summary

Use MCInst opcode name instead of opcode value in hashing.

Opcode values are unstable wrt changes to target tablegen definitions,
and we notice that as output mismatches in NFC testing. This makes BOLT YAML
profile tied to a particular LLVM revision which is less portable than
offset-based fdata profile.

Switch to using opcode names which have 1:1 mapping with opcode values for any
given LLVM revision, and are stable wrt modifications to .td files (except of
course modifications to names themselves).

Test Plan:
D150154 is a test commit adding new X86 instruction which shifts opcode values.
With current change, pre-aggregated-perf.test passes in nfc check mode.
Without current change, pre-aggregated-perf.test expectedly fails.

Diff Detail

Event Timeline

Amir created this revision.May 5 2023, 3:37 PM
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Amir requested review of this revision.May 5 2023, 3:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2023, 3:37 PM
Amir edited the summary of this revision. (Show Details)May 8 2023, 4:34 PM
rafauler accepted this revision.May 8 2023, 4:49 PM

Thanks

This revision is now accepted and ready to land.May 8 2023, 4:49 PM
This revision was automatically updated to reflect the committed changes.