This is an archive of the discontinued LLVM Phabricator instance.

[ARM][MachineOutliner] Add stack fixup feature.
AbandonedPublic

Authored by yroux on Nov 5 2020, 3:24 AM.

Details

Summary

This patch handles cases where we have to save/restore the link register into the stack and and load/store instruction which use the stack are part of the outlined region. It checks that there will be no overflow introduced by the new offset and fixup these instructions accordingly.

Diff Detail

Event Timeline

yroux created this revision.Nov 5 2020, 3:24 AM
yroux requested review of this revision.Nov 5 2020, 3:24 AM
chill added a subscriber: chill.Nov 5 2020, 4:30 AM
yroux updated this revision to Diff 306083.Nov 18 2020, 6:11 AM

Hi Yvan,

Sorry for the delay on this, it's taken some courage to look at this and I'm a bit confused to be honest! Can this be split into two patches..? One for enabling outlining of stack using instructions which don't need modifying and then another for handling the ones that need changing?

llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
5883

nit: Perform all the SPIdx check together?

6212

There isn't this check in the first pass, so could we be missing some instructions here?

yroux abandoned this revision.Dec 9 2020, 4:54 AM

Hi Sam,

I've split this patch into these two revisions:
https://reviews.llvm.org/D92933
https://reviews.llvm.org/D92934

Hope it will be more digest ;)
Thanks

llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
5883

I refactored this code in the new version

6212

I don't think we miss anything, but this is indeed not needed, and I've removed it in the new version