Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pschachte opened this issue Oct 11, 2023 · 4 comments

Comments

@pschachte
Copy link
Owner

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.

@jimbxb
Copy link
Collaborator

jimbxb commented Oct 12, 2023

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.

@pschachte
Copy link
Owner Author

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 :-(.

@jimbxb
Copy link
Collaborator

jimbxb commented Oct 12, 2023

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?

@pschachte pschachte changed the title Rewrite code generation not to use llvm-hs Update to LLMV version new enough to support M1,2,3 chips Apr 16, 2024
@pschachte
Copy link
Owner Author

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 pschachte changed the title Update to LLMV version new enough to support M1,2,3 chips Update to LLMV version new enough to support ARM chips, including Apple M1,2,3 chips Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants