This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Reduce stack frame for fastcc functions by only allocating parameter save area when needed
ClosedPublic

Authored by lei on Jan 26 2018, 2:43 PM.

Details

Summary

Current implementation always allocates the parameter save area conservatively for fastcc functions. There is no reason to allocate the parameter save area for fastcc function if all the parameters can be passed via registers.

This patch reduces the stack frame usage for:

  • stage2 bootstrap by 4%
  • gcc by 7%
  • perlbench and povray by 2%

SPEC2006 performance run shows no performance changes.

Diff Detail

Repository
rL LLVM

Event Timeline

lei created this revision.Jan 26 2018, 2:43 PM
lei updated this revision to Diff 131660.Jan 26 2018, 2:51 PM

This is only for LE.

nemanjai added inline comments.Feb 7 2018, 4:31 PM
test/CodeGen/PowerPC/fastcc_stacksize.ll
110 ↗(On Diff #131660)

We need to add a test case with a byval parameter where we don't need the parameter save area as well since the behaviour changes in this case as well.

lei updated this revision to Diff 133555.Feb 8 2018, 7:22 PM

Add test case for pass byval parameter where we don't need the parameter save area.

lei marked an inline comment as done.Feb 8 2018, 7:22 PM
This revision is now accepted and ready to land.Feb 15 2018, 5:21 AM
This revision was automatically updated to reflect the committed changes.