This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Implement probing for prologue
ClosedPublic

Authored by lkail on Jun 9 2020, 5:13 AM.

Details

Summary

This patch is part of supporting -fstack-clash-protection. Implemented probing when emitting prologue.

Diff Detail

Event Timeline

lkail created this revision.Jun 9 2020, 5:13 AM
jsji added inline comments.Jun 26 2020, 2:37 PM
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
679

We are in prologue, there shouldn't be any use of cr before this, why can't we simply always use CR0 here?

1030–1040

Can we add comments about free probe?

1032

Add comment about why we need this pseudo? and when it will be handled.

1372

Where -> StackAllocAIPos ?

1407

Comments/code mismatch? We are generating RLDICL/RLWINM below, please add comments about the calculation as well..

1437

What if we can't find CR and we don't build with assert on?

1446

There are several instance of similar code, maybe worth a NFC refactor first.

1459

We have to check. and do Residual block regardless of NumBlocks, please move it out of if/else.

1468

Shall we recomputeLiveIns for both LoopMBB and ExitBB?

lkail updated this revision to Diff 274059.Jun 29 2020, 4:37 AM

Address @jsji 's comments.

Use CTR loop to synthesize probe loop so that we can use a GPR to materialize large probe size.

lkail marked 7 inline comments as done.Jun 29 2020, 4:41 AM
lkail added inline comments.
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
679

Might be unavailable for complex case due to shrinkwrap. Now changed to CTR loop, looks not a concern any more.

1437

Changed to CTR loop.

lkail updated this revision to Diff 274062.Jun 29 2020, 4:44 AM
jsji accepted this revision as: jsji.Jun 30 2020, 1:39 PM
This revision is now accepted and ready to land.Jun 30 2020, 1:39 PM
This revision was automatically updated to reflect the committed changes.