Populate llvm.reserved from release LLVM IR bounds-check retention analysis#4
Merged
Coursant merged 6 commits intoSymbexpr-Cfrom Mar 22, 2026
Merged
Conversation
…ication Co-authored-by: Coursant <60531642+Coursant@users.noreply.github.com> Agent-Logs-Url: https://github.com/Coursant/RAP/sessions/8a3c7f02-dd4a-4372-91e9-9eec7a30db32
Co-authored-by: Coursant <60531642+Coursant@users.noreply.github.com> Agent-Logs-Url: https://github.com/Coursant/RAP/sessions/8a3c7f02-dd4a-4372-91e9-9eec7a30db32
Copilot
AI
changed the title
[WIP] Explain how to check if bounds check elimination is performed by LLVM
Clarify release-mode LLVM BCE verification workflow in Mar 22, 2026
range_assert
…etention Co-authored-by: Coursant <60531642+Coursant@users.noreply.github.com> Agent-Logs-Url: https://github.com/Coursant/RAP/sessions/4b1ea0a7-ec87-41eb-82e9-89a630e6962c
Co-authored-by: Coursant <60531642+Coursant@users.noreply.github.com> Agent-Logs-Url: https://github.com/Coursant/RAP/sessions/4b1ea0a7-ec87-41eb-82e9-89a630e6962c
…bustness Co-authored-by: Coursant <60531642+Coursant@users.noreply.github.com> Agent-Logs-Url: https://github.com/Coursant/RAP/sessions/4b1ea0a7-ec87-41eb-82e9-89a630e6962c
Copilot
AI
changed the title
Clarify release-mode LLVM BCE verification workflow in
Populate Mar 22, 2026
range_assertllvm.reserved from release LLVM IR bounds-check retention analysis
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 free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
bounds_checks_<crate>.jsonpreviously emittedllvm.reservedas an empty placeholder. This change makesllvm.reservedreflect whether MIR-discovered bounds checks are still retained after release LLVM lowering by deriving retention from emitted LLVM IR metadata.llvm.reservednow carries LLVM-derived retention data{}with structured output:analysis: "llvm-ir-release"records: [{ file, line, function, retained }]retainedis computed by matching source lines of MIR bounds-check records against LLVM panic callsites.Release IR generation integrated into DB construction
cargo rustc --release -- -Cdebuginfo=1 --emit=llvm-irRUSTC_WRAPPER,RAP_ARGS) is removed for this subprocess so IR emission is direct and deterministic.LLVM IR parsing and source mapping
target/release/deps/*.ll(respectsCARGO_TARGET_DIRwhen set).panic_bounds_check,slice_index_len_fail).!dbg !N→!DILocation(line: X, ...)to map retained checks back to source line numbers.!dbgrefs per instruction line.Failure mode made explicit
llvm.reservedis still populated with:analysiserrorrecordsParser-focused unit coverage
Example output shape:
{ "llvm": { "reserved": { "analysis": "llvm-ir-release", "records": [ { "file": "src/lib.rs", "line": 42, "function": "my_crate::foo", "retained": true } ] } } }⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.