wiki:Commentary/Compiler/Backends/LLVM/DevelopmentNotes

Version 14 (modified by dterei, 4 years ago) (diff)

--

Bugs & Other Problems

This page lists bugs and problems currently known about in the LLVM backend.

Unsupported GHC Features

Threaded

Dynamic 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.

GHC LLVM Back-end Bugs

Foreign Calls on Mac OSX

Foreign calls on Mac OS X don't work. Seems to be because LLVM isn't generating correct code. All system calls must be 16 byte aligned in OS X and llvm isn't respecting this. Not sure if its a bug in LLVM or due to my changes to LLVM.

Update (20/02/10): I fixed this issue using the inline assembler approach (see below). This reduces the test failures on Mac OSX from 22 to 9. So doesn't fix everything. Still other issues. Also, I tried using the new stalk alignment feature but that interacts badly with the GHC calling convention, clobbering the Base register.

Update (07/07/10): I think this issue is probably has probably been fixed by recent changes to fix alignment issues in Linux and Windows but I can't check as I don't have a Mac OS X machine any more.

Solutions:

  • A new function attribute has just landed in SVN which allows stack alignment to be specified when a call is made.
  • Can use inline assembler to fix stack alignment.
  • Fix stack calculation in LLVM (my changes must have broken it).

Repa examples - FFT segfaults

If you run the FFT program form repa-examples, it segfaults under the LLVM backend.