This is an archive of the discontinued LLVM Phabricator instance.

[ARM][LowOverheadLoops] Revert after read/write
ClosedPublic

Authored by samparker on Aug 6 2019, 2:00 AM.

Details

Summary

Currently we check whether LR is stored/loaded to/from in between the loop decrement and loop end pseudo instructions. There's two problems here:

  • It relies on all load/store instructions being labelled as such in tablegen.
  • Actually any use of loop decrement is troublesome because the value doesn't exist!

So we need to check for any read/write of LR that occurs between the two instructions and revert if we find anything.

Diff Detail

Repository
rL LLVM

Event Timeline

samparker created this revision.Aug 6 2019, 2:00 AM

Is a Use of LR a problem? As in, if something needed to use the value of "i" in a loop, could it not end up using LR for that? (I agree checking defs is likely better than just checking load/stores).

Anything is allowed to use the value of LR, just not after it has been updated by LoopDec.

dmgreen accepted this revision.Aug 6 2019, 4:54 AM

Ah yeah. I was confused into thinking it was iterating in reverse order.

LGTM then.

This revision is now accepted and ready to land.Aug 6 2019, 4:54 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2019, 12:40 AM