This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Introduce i8neg and i8pos addressing modes
ClosedPublic

Authored by dmgreen on Nov 26 2021, 6:16 AM.

Details

Summary

Some instructions with i8 immediate ranges can only hold negative values (like t2LDRHi8), only hold positive values (like t2STRT) or hold +/- depending on the U bit (like the pre/post inc instructions. e.g t2LDRH_POST). This patch splits the AddrModeT2_i8 into AddrModeT2_i8, AddrModeT2_i8pos and AddrModeT2_i8neg to make this clear.

This allows us to get the offset ranges of t2LDRHi8 correct in the load/store optimizer, fixing issues where we could end up creating instructions with positive offsets (which may then be encoded as ldrht).

Diff Detail

Event Timeline

dmgreen created this revision.Nov 26 2021, 6:16 AM
dmgreen requested review of this revision.Nov 26 2021, 6:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 26 2021, 6:16 AM
dmgreen edited reviewers, added: chill; removed: momchil.velikov.Nov 26 2021, 6:16 AM
SjoerdMeijer accepted this revision.Dec 1 2021, 3:43 AM

Looks like an improvement to me.

This revision is now accepted and ready to land.Dec 1 2021, 3:43 AM
This revision was landed with ongoing or failed builds.Dec 2 2021, 9:10 AM
This revision was automatically updated to reflect the committed changes.

FYI, I filed https://github.com/llvm/llvm-project/issues/52681 for a crash that this patch causes.