Skip to content

Update to LLVM 17.0.1 #4680

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

Merged
merged 10 commits into from
Apr 22, 2025
Merged

Update to LLVM 17.0.1 #4680

merged 10 commits into from
Apr 22, 2025

Conversation

IgorDeepakM
Copy link
Contributor

This is a continuation of #4570.

LLVM version is increased to 17.0.1 instead.

hovsater and others added 8 commits April 18, 2025 23:35
This is no longer available in LLVM 16.

See also:

* https://reviews.llvm.org/D135041
This is no longer available in LLVM 16.

See also:

* https://reviews.llvm.org/D136615
The function LLVMConstFNeg has been removed, because the underlying
constant expression in no longer supported. Instead, an instruction
should be created using the LLVMBuildFNeg function, which will constant
fold the operands if possible and create an instruction otherwise.

See also:

* https://releases.llvm.org/16.0.0/docs/ReleaseNotes.html#changes-to-the-c-api
Increased LLVM to 17.0.1
Function attribute inaccessiblemem_or_argmemonly replaced with
memory(argmem: readwrite, inaccessiblemem: readwrite).
Removed readonly and readnone for some pony internal functions
because they are functions and not supported with these
attributes.
Removed deprecated PassRegistry code that is no longer available.
Optimizations are already done in optimise function in genopt.cc
which already uses the new PassBuilder.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Apr 18, 2025
@SeanTAllen SeanTAllen added the changelog - changed Automatically add "Changed" CHANGELOG entry on merge label Apr 18, 2025
@ponylang-main
Copy link
Contributor

Hi @IgorDeepakM,

The changelog - changed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 4680.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

@SeanTAllen SeanTAllen requested review from chalcolith and jemc April 18, 2025 23:52
@IgorDeepakM
Copy link
Contributor Author

IgorDeepakM commented Apr 19, 2025

I think regression-1118 is close to the threshold of the timeout of 120 seconds. In a test with LLVM 15:
[ OK ] regression-1118 (109404 ms)
I see slightly higher test times with the sanitizer with the LLVM 17 build so this 120 second limit probably passed. Not sure if this depends on LLVM 17 or server load.

@SeanTAllen SeanTAllen changed the title Increase LLVM version to 17 Update to LLVM 17 Apr 20, 2025
@SeanTAllen
Copy link
Member

Which LLVM version does this update to 17.0.6?

@IgorDeepakM
Copy link
Contributor Author

Which LLVM version does this update to 17.0.6?

17.0.1 (tag: llvmorg-17.0.1)

@SeanTAllen
Copy link
Member

@IgorDeepakM was there a change that was technically tricky that made it more work to go to the latest llvm 17?

@IgorDeepakM
Copy link
Contributor Author

@IgorDeepakM was there a change that was technically tricky that made it more work to go to the latest llvm 17?

No, the only changed required for LLVM 17 was removal of LLVMGetGlobalPassRegistry();

  LLVMPassRegistryRef passreg = LLVMGetGlobalPassRegistry();
  LLVMInitializeCore(passreg);
  LLVMInitializeTransformUtils(passreg);
  LLVMInitializeScalarOpts(passreg);
  LLVMInitializeVectorization(passreg);
  LLVMInitializeInstCombine(passreg);
  LLVMInitializeIPO(passreg);
  LLVMInitializeAnalysis(passreg);
  LLVMInitializeIPA(passreg);
  LLVMInitializeCodeGen(passreg);
  LLVMInitializeTarget(passreg);

The rest are LLVM 16 related.

@IgorDeepakM
Copy link
Contributor Author

IgorDeepakM commented Apr 20, 2025

There is still an open question if the readnone and readonly removal for functions like pony_ctx, should be replaced with memory(none) and memory(read).

Added defines for memory effects that corresponds to the
MemoryEffects C++ LLVM interface.
Reinstated the readonly and readnone attributes for @pony_ctx,
@pony_get_exitcode and @memcmp but with the new memory effects
attributes
readnone -> memory(none)
readonly -> memory(argmem: read)
@jemc
Copy link
Member

jemc commented Apr 22, 2025

There is still an open question if the readnone and readonly removal for functions like pony_ctx, should be replaced with memory(none) and memory(read).

I have verified that this is correct (in the sync call today).

@SeanTAllen SeanTAllen changed the title Update to LLVM 17 Update to LLVM 17.0.1 Apr 22, 2025
@SeanTAllen SeanTAllen merged commit 9eaffad into ponylang:main Apr 22, 2025
28 checks passed
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Apr 22, 2025
github-actions bot pushed a commit that referenced this pull request Apr 22, 2025
github-actions bot pushed a commit that referenced this pull request Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - changed Automatically add "Changed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants