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 build with LLVM 20. #565

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Fix build with LLVM 20. #565

merged 1 commit into from
Oct 15, 2024

Conversation

hvdijk
Copy link
Collaborator

@hvdijk hvdijk commented Oct 15, 2024

Overview

Fix build with LLVM 20.

Reason for change

  • LLVM 20 renames Intrinsic::getDeclaration to Intrinsic::getOrInsertDeclaration.
  • LLVM 20 deprecates instruction creation overloads that take an Instruction * as an insertion point, recommending the ones that take an iterator instead. In LLVM 18, for the most part, those overloads taking iterators do not yet exist.

Description of change

  • Handle the Intrinsic function rename with a multi_llvm::GetOrInsertIntrinsicDeclaration helper function.
  • In LLVM 18, Instruction::insertBefore does already take iterators, so rework the code to consistently use that. This removes some bitcast instructions in memory_operations.cpp that could not be updated, but had become unnecessary ever since LLVM switched to opaque pointers.

Anything else we should know?

If there's any other relevant information we should know that may help us in
understanding and verifying your patch, please include it here.

Checklist

  • Read and follow the project Code of Conduct.
  • Make sure the project builds successfully with your changes.
  • Run relevant testing locally to avoid regressions.
  • Run clang-format-19 on all modified code.

@hvdijk hvdijk force-pushed the llvm20 branch 2 times, most recently from 7468d1d to e82f8d3 Compare October 15, 2024 14:20
* LLVM 20 renames Intrinsic::getDeclaration to
  Intrinsic::getOrInsertDeclaration. Handle this with a
  multi_llvm::GetOrInsertIntrinsicDeclaration helper function.
* LLVM 20 deprecates instruction creation overloads that take an
  Instruction * as an insertion point, recommending the ones that take
  an iterator instead. In LLVM 18, for the most part, those overloads
  taking iterators do not yet exist, but Instruction::insertBefore does
  already take iterators, so rework the code to consistently use that.
  This removes some bitcast instructions in memory_operations.cpp that
  could not be updated, but had become unnecessary ever since LLVM
  switched to opaque pointers.
@hvdijk hvdijk merged commit a9217d0 into uxlfoundation:main Oct 15, 2024
7 checks passed
@hvdijk hvdijk deleted the llvm20 branch October 15, 2024 17:57
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