You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
This patch modernizes LLVM IR by replacing explicit null-check icmp ne ptr %p, null + llvm.assume(i1 %cond) sequences with the more expressive and semantically richer llvm.assume(i1 true) [ "nonnull"(ptr %p) ] intrinsic.
The major changes are:
NonNull Assumption Migration: Over 100 instances across numerous benchmarks (e.g., abseil-cpp, actix-rs, anki-rs, boost, clap-rs, faiss, graphviz, hyper-rs, icu, influxdb-rs, libquic, memcached, mini-lsm-rs, mitsuba3, ocio) are updated to use the "nonnull" attribute on llvm.assume. This provides stronger, more actionable information to the optimizer than a generic boolean assumption.
Removal of Redundant TBAA/NonNull/Noundef Metadata: In many places (e.g., cord_rep_crc.ll, reflection.ll, Variable.ll, cord_test.ll, reflection_test.ll, DcsDecoder.ll, cord_rep_consume.ll), the !nonnull and !noundef metadata tags are removed from load instructions. This is because the new "nonnull" assumption on llvm.assume already conveys the same non-null guarantee, making the redundant load metadata unnecessary.
LLVM Function Attribute Updates: The declaration for @llvm.assume is updated in multiple files (cord_rep_crc.ll, deku-rs/...ll, egg-rs/...ll, ipopt/...ll, jemalloc/...ll) to use the precise attribute set mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write), replacing older, less specific sets like memory(argmem: readwrite).
Phi Node and Branch Target Adjustments: Several patches fix phi node operands and branch targets that were misaligned due to previous rewrites (e.g., anki-rs/...ll, elfshaker-rs/...ll, mitsuba3/...ll, rapass.ll). This ensures control flow integrity after other transformations.
Cleanup of Obsolete Profiling and Debug Metadata: The patch removes obsolete or unused metadata, such as !19 = !{} and !20 = !{!"branch_weights", ..."} in cord_rep_crc.ll, and updates !prof metadata to point to the correct, newly defined !19 in several files, improving metadata hygiene.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link: llvm/llvm-project#169923
Requested by: @nikic