Page MenuHomePhabricator

[ARM] Expand distributing increments to also handle existing pre/post inc instructions.

Authored by dmgreen on Jul 8 2020, 2:57 AM.



This extends the distributing postinc code in load/store optimizer to also handle the case where there is an existing pre/post inc instuction, where subsequent instructions can be modified to use the adjusted increment from the increment. This can save us having to keep the old register live past the increment instruction.

Diff Detail

Event Timeline

dmgreen created this revision.Jul 8 2020, 2:57 AM
samparker added inline comments.Aug 7 2020, 1:08 AM

The function name doesn't appear to match that opcodes that it's checking?


I'm still a bit concerned with this loop.... Can't we get in a pickle if there are two or more instructions within the loop which use BaseReg with a zero offset? OtherAccesses relies on BaseAccess only being assigned once, right? Don't we also need to ensure that BaseReg isn't assigned between BaseAccess and OtherAccesses?

dmgreen updated this revision to Diff 291878.Sep 15 2020, 5:51 AM

Rebase and rename backwards function.

dmgreen added inline comments.Sep 15 2020, 5:53 AM

Oh. Whoops!


If I understand what you are saying properly.. We are in SSA form still, in this pre-ra pass. We shouldn't be reassigning BaseReg.

But I may have missed the point and it's been a while since I wrote this. Let me know.

Thanks, LGTM


Ah! Yes, I had completely missed the 'ARMPreAllocLoadStoreOpt::'

samparker accepted this revision.Sep 17 2020, 12:48 AM
This revision is now accepted and ready to land.Sep 17 2020, 12:48 AM