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

Upgrade to LLVM 15, support Apple M1. #1264

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Upgrade to LLVM 15, support Apple M1. #1264

wants to merge 8 commits into from

Conversation

dan-zheng
Copy link
Collaborator

@dan-zheng dan-zheng commented Apr 4, 2023

Main changes:


Status: work-in-progress.

  • make now works on Apple M1.
    • The easiest path to Apple M1 support I found involved upgrading both GHC (details) and LLVM.
  • make unit-tests passes.
  • Fix compiler warnings (full log).
    • There are many -Wincomplete-uni-patterns warnings because -Wincomplete-uni-patterns was added to -Wall in GHC 9.2.1 (source).
  • make tests passes.

Fixes #1247.

@dan-zheng dan-zheng mentioned this pull request Apr 4, 2023
@dan-zheng dan-zheng force-pushed the llvm-15 branch 20 times, most recently from 9edb341 to 7cd1c47 Compare April 5, 2023 13:14
@dan-zheng dan-zheng force-pushed the llvm-15 branch 9 times, most recently from aeee683 to 5a49aa5 Compare April 12, 2023 07:24
@dan-zheng
Copy link
Collaborator Author

I believe this is ready for review now. @dougalm

Let me know if I should do anything else!

- Upgrade to GHC 9.2.x.
  - Apple M1 support seems to be mostly mature starting in GHC 9.2.1:
    https://www.haskell.org/ghc/blog/20210309-apple-m1-story.html.
- Upgrade to LLVM 15.
  - Use the same resolver in stack*.yaml files as llvm-hs:llvm-15 for
    consistency.

`make` now works on Apple M1, albeit with compiler warnings, some of which seem
significant.
Fix warnings, namely -Wstar-is-type.

Many -Wincomplete-uni-patterns warnings are not yet fixed.
`diff` on macOS does not support the `--left-column` flag.

Use `sdiff` (side-by-side diff) instead, which is part of diffutils.
- Fix dependency versions in stack.yaml.
- Fix dependency installation (`install_deps`) in haskell-ci.yaml and
  python-ci.yaml.
- Run pytest with `-v` to show testcase names, for easier debugging.
@dan-zheng dan-zheng force-pushed the llvm-15 branch 2 times, most recently from 6802485 to e542739 Compare May 19, 2023 21:23
Fix all warnings except `-Wincomplete-uni-patterns` and `-Wincomplete-record-updates`,
which were newly added to `-Wall` (starting in GHC 9.2.1).

https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0071-Wall-uni-patterns.rst
- Update `llvm.memcpy` and `llvm.memset` intrinsic name mangling to use `p0`
  instead of `p0i8` as the pointer type.
  - https://releases.llvm.org/15.0.0/docs/LangRef.html#llvm-memcpy-intrinsic
- Update expected numerical values in various tests.
- Mark and disable failing tests with `FIXME(llvm-15)`.
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

Successfully merging this pull request may close these issues.

Building on M1 Mac
2 participants