wybe icon indicating copy to clipboard operation
wybe copied to clipboard

Update to LLMV version new enough to support ARM chips, including Apple M1,2,3 chips

Open pschachte opened this issue 1 year ago • 4 comments

It's time to abandon llvm-hs. It's dead, Jim. There hasn't been a commit to it in a year, and it's just not making progress. We need to support both Intel and Apple M1 and M2, and ideally ARM chips in general, and there's no progress on making llvm-hs support that.

There are two alternative solutions: write our own C++-based Haskell interface to LLVM AST, or just generate a .ll text file, and use the normal LLVM assembler to generate and optimise code. I expect the latter approach would be easier.

pschachte avatar Oct 11 '23 23:10 pschachte

Well this is annoying. I did mention in #380 about using the LLVM 15 branch. I see that has been committed to in the past 2mos, which is better than the default branch!

If we do opt to roll our own, I'd be more in favour of the latter. I'd suspect that it's less to maintain than a C++ project.

jimbxb avatar Oct 12 '23 00:10 jimbxb

Yeah, but the LLVM 15 branch shows a bright red X indicating that some CI tests fail.

The current main branch is LLVM 12. I thought we should move to that, but when I tried to install llvm-hs/llvm/llvm-12 using Homebrew on my M1 Mac, it didn't build. The open source ecosystem on Macs is not at the same level as Linux :-(.

pschachte avatar Oct 12 '23 01:10 pschachte

Yes, indeed. The tests are for some (older) versions of GHC on MacOS. Perhaps if we support a higher version than that we'd be okay?

jimbxb avatar Oct 12 '23 01:10 jimbxb

I think LLVM version 15 is new enough. The newest LLVM version supported by llvm-hs is 15, but that's not stable. We might be able to stick with it, but llvm-hs-pretty looks to be stuck at version 9, so we might not be able to use that.

pschachte avatar Apr 16 '24 09:04 pschachte