fix(LLVM): add --disable-non-volatile-memops and use it consistently#6416
Open
fix(LLVM): add --disable-non-volatile-memops and use it consistently#6416
Conversation
For the given function, the rust-analyzer is really unhappy and any intellisense is terribly slow.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a CLI switch to control LLVM’s “non-volatile memory ops” behavior (restoring pre-#6212 trap-on-OOB semantics when disabled) and refactors LLVM codegen to centralize/standardize how loads, stores, and atomics are emitted and annotated.
Changes:
- Add
--disable-non-volatile-memops(LLVM-only) and use it to conditionally enableenable_non_volatile_memops()in CLI engine configuration. - Refactor LLVM translator load/store/atomic emission via new
build_annotated_*helpers (and passTargetDatainto the function code generator for size computations). - Add a regression test for #6401 covering the “dropped SIMD load should still trap” behavior under volatile memops.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/compilers/issues.rs |
Adds a regression test for #6401 validating trap behavior differences between volatile vs non-volatile memops in LLVM. |
lib/compiler-llvm/src/translator/code.rs |
Introduces helper builders for annotated load/store/atomics and refactors operator lowering to use them consistently. |
lib/cli/src/backend.rs |
Adds the --disable-non-volatile-memops runtime option and wires it into LLVM engine/config setup. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
This PR introduces the
--disable-non-volatile-memopsCLI option, which preserves the use of thevolatilekeyword for memory operations (as it was prior to #6212). Additionally, it refactors how load and store operations are emitted, significantly simplifying and unifying theOperator::Xexpansion.Fixes: #6401