Page MenuHomePhabricator

[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

Unit TestsFailed

TimeTest
390 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp

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