Page MenuHomePhabricator

[RISCV] Fix RISCVInstrInfo::getInstSizeInBytes for atomics pseudos
Needs ReviewPublic

Authored by jrtc27 on Apr 3 2020, 5:13 PM.

Details

Summary

Without these, the generic branch relaxation pass will underestimate the
range required for branches spanning these and we can end up with
"fixup value out of range" errors rather than relaxing the branches.
Some of the instructions in the expansion may end up being compressed
but exactly determining that is awkward, and these conservative values
should be safe, if slightly suboptimal in rare cases.

Diff Detail

Event Timeline

jrtc27 created this revision.Apr 3 2020, 5:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2020, 5:13 PM
jrtc27 edited the summary of this revision. (Show Details)Apr 3 2020, 6:21 PM
jrtc27 updated this revision to Diff 254976.Apr 3 2020, 6:24 PM

Correct comment.

LGTM. I guess some may be difficult to test. CodeGen/RISCV/branch-relaxation.ll CodeGen/AArch64/branch-relax-bcc.ll ...

Thanks for the fix Jessica.
Looking at, say, doAtomicBinOpExpansion it's not immediately obvious why some of those values are correct. Can you please provide more info, ideally in the code?
Is there really no way to provide tests for these?