Changes between Version 12 and Version 13 of Commentary/Compiler/Backends/LLVM/DevelopmentNotes


Ignore:
Timestamp:
Jul 8, 2010 10:32:43 AM (4 years ago)
Author:
dterei
Comment:

Remove fixed bugs

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/Backends/LLVM/DevelopmentNotes

    v12 v13  
    99 
    1010Dynamic library support hasn't been tested at all in the LLVM backend. No work has been done on it. Its very unlikely that this feature works in the LLVM backend at the moment. 
    11  
    12 == LLVM Bugs == 
    13  
    14 === !NoReturn === 
    15  
    16 Don't use the `NoReturn` function attribute. It causes the LLVM optimiser to produce bad code as it replaces the following sequence of instructions: 
    17  
    18 {{{ 
    19 tail call fastcc void (i32,i32,i32,i32)* %nnO( i32 %nnP,i32 %nnQ,i32 %nnR,i32 %nnS ) 
    20 ret void 
    21 }}} 
    22  
    23 with: 
    24  
    25 {{{ 
    26 tail call fastcc void (i32,i32,i32,i32)* %nnO( i32 %nnP,i32 %nnQ,i32 %nnR,i32 %nnS ) 
    27 unreachable 
    28 }}} 
    29  
    30 which stops `llc` producing native code that actually tail calls and thus leads to a runtime segfault. 
    31  
    32 '''TODO''': Need to investigate this further and submit a bug report to LLVM. 
    3311 
    3412== GHC LLVM Back-end Bugs == 
     
    4523 * Fix stack calculation in LLVM (my changes must have broken it). 
    4624 
    47 === Segfault running HRay === 
    48  
    49 [http://users.elis.ugent.be/~kehoste/Haskell/HRay/ HRay] is a Haskell Ray Tracer. If you download it and build it with the LLVM backend, some scenes (such as trans2, provided example scene) cause it to segfault. If built with NCG instead this doesn't occur. 
    50  
    51 === Possible Problems (Unconfirmed Bugs) === 
    52  
    53  * See GHC trac ticket #1852. Floats are padded to word size (4 extra bytes on a 64 bit machine) by putting an appropriate `CmmLit` before them. On `fasm` this is necessary and forces the NCG to produce correct code. On `fvia-C`, this isn't necessary so it strips this padding out. What approach does LLVM blocks end in a control flow statement which seems pretty useful to me.  need? 
    54  
    55  * {{{SPARC/CodeGen/Gen32.hs}}} seems to have a few special cases for `CmmMachOp`. Perhaps these should also be handled in LLVM to improve performance? 
    56  
    57  * tail call only supported on `x86`/`x86-64` and `PowerPC`. What about `SPARC`? How will we use the LLVM back-end on SPARC? 
    58  
    5925=== Repa examples - FFT segfaults === 
    6026