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 legacy llvm.assume calls with the newer nonnull attribute-based form and updates memory access attributes in function declarations.
llvm.assume Replacement: All instances of explicit null-check assumptions (icmp ne ptr %p, null + llvm.assume) are replaced with direct llvm.assume(i1 true) [ "nonnull"(ptr %p) ]. This improves readability and enables better optimization opportunities via nonnull metadata.
Function Memory Attributes Upgrade: Several functions have their memory(...) attributes updated to include inaccessiblemem: write (e.g., memory(read, argmem: readwrite, inaccessiblemem: write)), reflecting that they may write to inaccessible memory — a more precise modeling than the previous inaccessiblemem: none.
llvm.assume Declaration Updates: The declaration of @llvm.assume is updated across multiple files to use memory(inaccessiblemem: write) instead of argmem: readwrite, aligning with its side-effect-free but memory-impacting semantics.
Phi Node and Branch Target Adjustments: In several places (e.g., Boost, Actix-RS), phi node operand lists and branch targets are updated due to basic block renumbering or restructuring, indicating underlying control flow changes that accompany the assume updates.
Redundant Null Checks Removed: In some cases (e.g., abcDfs.ll, clap-rs), redundant null checks on pointers already known to be non-null (e.g., from prior nonnull assumptions or API contracts) are eliminated, simplifying the IR.
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
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