PPC NCG: Fix and refactor TOC handling.
authorPeter Trommler <ptrommler@acm.org>
Sat, 18 Jun 2016 10:29:12 +0000 (12:29 +0200)
committerBen Gamari <ben@smart-cactus.org>
Sat, 18 Jun 2016 22:27:06 +0000 (00:27 +0200)
commitf4b0488dba4c97630ed1e4417eef546abd5c3df5
treeda8aad0cc1c92206d5308bf4aa13a6ac5e80a116
parent2897be77123bf31cad1c60dd5560eba7f2f021ce
PPC NCG: Fix and refactor TOC handling.

In a call to a fixed function the TOC does not need to be saved.
The linker handles TOC saving.

Refactor TOC handling by folding the two functions toc_before and
toc_after into the code generating the call sequence. This saves
repeating the case distinction in those two functions.

Test Plan: validate on PowerPC 32-bit Linux and AIX

Reviewers: hvr, simonmar, austin, erikd, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2328
compiler/nativeGen/PPC/CodeGen.hs