Is there a way to compile Haskell to run on the Xeon Phi coprocessor?
Some researchers at Intel have recently reported on the Haskell Research Compiler (that is not publicly available, which makes their results essentially irreproducible) and measured the Haskell Gap (showing that in some cases Haskell performance surpasses C). They describe a compilation route via an intermediate language called Pillar (similar to C--) and compile it to C so they then can use icc to create object code that is executable on a Phi.
GHC supports compilation to LLVM or generates native code directly (NCG). As far as I'm aware, neither is there a NCG targeting Phi available, nor an LLVM backend for the Phi. Having access to icc, a route via C seems possible, however I'm not sure how realistic it is at present (I think C code generator in GHC is no longer supported, the same is true for LLVM IR-to-C backend, correct me if I'm wrong).
So three routes come to mind:
Compile GHC in unregistered mode and compile with
-fvia-c
then with iccUse older GHC version to generate C code and then use icc
Use older LLVM version to go via GHC LLVM then generate C from LLVM and then use icc
Which route is most viable (why/why not)? Are there are other possibilities (I dismissed the Pillar route since the tools such as pillar2c are not (yet?) publicly available).
A related question is about x86 compatibility of the Phi -- it seems like SSE/AVX instructions are not supported and some object code would fail to run if compiled with e.g. gcc or clang.
Update:
After chatting to some Intel folks at the LLVM conference, it seems unlikely that they will release their Phi LLVM backend. However, next generation of Xeon Phi will support AVX512.