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

Add basic support for LLVM 18 #63

Merged
merged 4 commits into from
May 18, 2024

Conversation

Benjins
Copy link
Contributor

@Benjins Benjins commented May 4, 2024

  • Added support for LLVM 18
  • Added tests for it, tweaked the expected basic blocks/values since the optimiser outputs different code
  • Changed the LLVM 17 compatibility test from a textual IR file to a bitcode file: bitcode files have forward compatibility, but the textual IR does not. Since it referenced the webkit_jscc calling convention, which was removed in LLVM 18, this was breaking the test
  • Removed various constant expressions that have been removed from the IR

LLVM Release notes: https://releases.llvm.org/18.1.0/docs/ReleaseNotes.html

A couple more things to note:

  • I think the testing code/harness could use some tweaks: right now updating to a new LLVM version means potentially a lot of churn depending on if the optimiser changed. It is good to know that it can read bitcode files generated by newer versions of Clang, but right now the tests are a bit fragile. Not sure if other folks have thoughts on it
  • There are a lot of new APIs in LLVM 18, e.g. support for fast math flags and inline assembly. This PR doesn't add them, but I can make follow-up PRs once this lands
  • The issue with LLVMGetOrdering (in Test failures from LLVM C API accessor issues #44) was fixed, so I was hoping that'd mean we could run the tests in debug mode. However, LLVM 18 also introduced a new issue with atomicrmw instructions that caused a similar crash when running the tests in debug mode. That should now be fixed come LLVM 19, and I'll update the issue with more details

…ome new optimisation, so had a fair bit of churn. LLVM 17 compatibility test was changede from ll to bc: The bitcode files guarantee forwards compatibility, which we need now that LLVM 18 dropped support for the webkit_jscc calling convention
… in LLVM 18:

 - and
 - or
 - lshr
 - ashr
 - zext
 - sext
 - fptrunc
 - fpext
 - fptoui
 - fptosi
 - uitofp
 - sitofp
Copy link
Owner

@cdisselkoen cdisselkoen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for this effort! Looks great. I agree we should make the tests less fragile to changes in LLVM's optimizer, but it is still good to check that the details (fields) of various different kinds of instructions/blocks are parsed correctly ... maybe we should use the compatibility bitcode file for more of these tests, instead of bitcode files generated directly from C. But obviously that can be for a future issue.

@cdisselkoen cdisselkoen merged commit d721f54 into cdisselkoen:main May 18, 2024
10 checks passed
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.

2 participants