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

Fix #40 by bumping llvm-pretty{,-bc-parser submodules and passing -ffp-contract=off to Clang #41

Merged
merged 5 commits into from
Dec 13, 2023

Conversation

RyanGlScott
Copy link
Collaborator

This PR contains a series of patches that, when combined, fix #40:

  • Bump the llvm-pretty and llvm-pretty-bc-parser submodules to bring in a series of PRs that allow copilot-verifier to support up to LLVM 16.
  • While testing with Clang 14, I discovered that Clang 14+ now enable -ffp-contract=on by default, which cause floating-point expressions such as a + b * c to be optimized to fused multiply-add LLVM intrinsics (e.g., llvm.fmuladd.*). This is a problem for copilot-verifier, which critically relies on preserving the order of additions and mulitplications. Thankfully, we can override this option by explicitly passing -ffp-contract=off to Clang.
  • Explicitly document the fact that copilot-verifier supports up to LLVM 16 in the README.

This requires some minor code changes to adapt to renamed functions in
`copilot-3.17`.
Clang 14+ enable `-ffp-contract=on` by default, which cause floating-point
expressions such as `a + b * c` to be optimized to fused multiply-add LLVM
intrinsics (e.g., `llvm.fmuladd.*`). This is a problem for `copilot-verifier`,
which critically relies on preserving the order of additions and
mulitplications. Thankfully, we can override this option by explicitly passing
`-ffp-contract=off` to Clang.
See the comments in the `cabal.project` for why this is necessary.
@RyanGlScott RyanGlScott merged commit 75a7c06 into main Dec 13, 2023
3 checks passed
@RyanGlScott RyanGlScott deleted the T40 branch December 13, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

LLVMParseError on LLVM 14.0.0
1 participant