Multiple fixes / improvements for LLVM backend
authorKavon Farvardin <kavon@farvard.in>
Thu, 4 Oct 2018 17:44:55 +0000 (13:44 -0400)
committerBen Gamari <ben@smart-cactus.org>
Fri, 5 Oct 2018 22:48:16 +0000 (18:48 -0400)
commit73273be476a8cc6c13368660b042b3b0614fd928
treee7bf2882ae10a7ada73339af869d725d0465b778
parent4338398f09d3b8ca472ed46ce92602566913f2aa
Multiple fixes / improvements for LLVM backend

- Fix for #13904 -- stop "trashing" callee-saved registers, since it is
  not actually doing anything useful.

- Fix for #14251 -- fixes the calling convention for functions passing
  raw SSE-register values by adding padding as needed to get the values
  in the right registers. This problem cropped up when some args were
  unused an dropped from the live list.

- Fixed a typo in 'readnone' attribute

- Added 'lower-expect' pass to level 0 LLVM optimization passes to
  improve block layout in LLVM for stack checks, etc.

Test Plan: `make test WAYS=optllvm` and `make test WAYS=llvm`

Reviewers: bgamari, simonmar, angerman

Reviewed By: angerman

Subscribers: rwbarton, carter

GHC Trac Issues: #13904, #14251

Differential Revision: https://phabricator.haskell.org/D5190

(cherry picked from commit adcb5fb47c0942671d409b940d8884daa9359ca4)
compiler/llvmGen/Llvm/Types.hs
compiler/llvmGen/LlvmCodeGen/Base.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
llvm-passes
testsuite/tests/codeGen/should_run/all.T