wiki:Commentary/Compiler/CodeGen

Code Generator

This page describes code generator ("codegen") in GHC. It is meant to reflect current state of the implementation. If you notice any inaccuracies please update the page (if you know how) or complain on ghc-devs.

A brief history of code generator

You might occasionally hear about "old" and "new" code generator. GHC 7.6 and earlier used the old code generator. New code generator was being developed since 2007 and it was enabled by default on 31 August 2012 after the release of GHC 7.6.1. The first stable GHC to use the new code generator is 7.8.1 released in early 2014.

Various historical pages, with still-useful info:

Tickets

Use Keyword = CodeGen to ensure that a ticket ends up on these lists.

Open Tickets:

#2725
Remove Hack in compiler/nativeGen/X86/CodeGen.hs
#2731
Avoid unnecessary evaluation when unpacking constructors
#4121
Refactor the plumbing of CafInfo to make it more robust
#8871
No-op assignment I64[BaseReg + 784] = I64[BaseReg + 784]; is generated into optimized Cmm
#8887
Double double assignment in optimized Cmm on SPARC
#8903
Add dead store elimination
#8905
Function arguments are always spilled/reloaded if scrutinee is already in WHNF
#9718
Avoid TidyPgm predicting what CorePrep will do
#10012
Cheap-to-compute values aren't pushed into case branches inducing unnecessary register pressure
#10074
Implement the 'Improved LLVM Backend' proposal
#13904
LLVM does not need to trash caller-saved registers.

Closed Tickets:

#7571
LLVM codegen does not handle integer literals in branch conditionals.
#7574
Register allocator chokes on certain branches with literals
#7575
LLVM backend does not properly widen certain literal types in call expressions
#8585
Loopification should omit stack check
#9157
cmm common block not eliminated
#9159
cmm case, binary search instead of jump table
#11372
Loopification does not trigger for IO even if it could
#12095
GHC and LLVM don't agree on what to do with byteSwap16#

Last modified 6 months ago Last modified on Apr 11, 2017 12:59:45 PM