-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Include llvm-as in llvm-tools-preview component #78968
Conversation
Including llvm-as adds the ability to include assembly language fragments that can be inlined using LTO.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Hm, can you say more about the use case here? How are you planning to run this tool? |
The use case that prompted this involves memory barriers on an ARM Cortex-M4 processor using (hopefully) stable Rust (so no inline assembly anytime soon). I'm paranoid about memory ordering when it comes to peripheral access, so I'd like to be able to use barrier instructions to ensure that certain sets of reads and writes occur before other sets. A barrier is one or two instructions, so calling external object code linked in whole seems excessive (otherwise, I'd just use As for running the tool, I intend to do that from a build script using the If this seems like a case where I'm committing a category error and this is better solved another way, be sure to let me know... I think this is reasonable, but it is also outside my normal wheelhouse. |
I would guess that looking at the core::arch module might yield nicer looking code, I would expect most memory barrier instructions to be in there. The arm modules are currently unstable though. I should also caution that as a preview component, the contents and availability of the llvm-tools component are not considered part of the stability promise. There's also not really a guarantee that LLVM will indefinitely be the backend rustc uses. That said, it seems not altogether different from the other use cases for these tools, so I'm going to go ahead and @bors r+ |
📌 Commit e4a43fc has been approved by |
@Mark-Simulacrum Understood that this is trading off one sort of instability for another; I'm OK with that. Thank you for reviewing this PR. |
Include llvm-as in llvm-tools-preview component Including `llvm-as` adds the ability to include assembly language fragments that can be inlined using LTO while making sure the correct version of LLVM is always used.
Include llvm-as in llvm-tools-preview component Including `llvm-as` adds the ability to include assembly language fragments that can be inlined using LTO while making sure the correct version of LLVM is always used.
Include llvm-as in llvm-tools-preview component Including `llvm-as` adds the ability to include assembly language fragments that can be inlined using LTO while making sure the correct version of LLVM is always used.
Rollup of 15 pull requests Successful merges: - rust-lang#78352 (Do not call `unwrap` with `signatures` option enabled) - rust-lang#78590 (refactor: removing alloc::collections::vec_deque ignore-tidy-filelength) - rust-lang#78848 (Bump minimal supported LLVM version to 9) - rust-lang#78856 (Explicitly checking for or-pattern before test) - rust-lang#78948 (test: add `()=()=()=...` to weird-exprs.rs) - rust-lang#78962 (Add a test for r# identifiers) - rust-lang#78963 (Added some unit tests as requested) - rust-lang#78966 (Never inline C variadics, cold functions, functions with incompatible attributes ...) - rust-lang#78968 (Include llvm-as in llvm-tools-preview component) - rust-lang#78969 (Normalize function type during validation) - rust-lang#78980 (Fix rustc_ast_pretty print_qpath resulting in invalid macro input) - rust-lang#78986 (Avoid installing external LLVM dylibs) - rust-lang#78988 (Fix an intrinsic invocation on threaded wasm) - rust-lang#78993 (rustc_target: Fix dash vs underscore mismatches in option names) - rust-lang#79013 (Clean up outdated `use_once_payload` pretty printer comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Including
llvm-as
adds the ability to include assembly language fragments that can be inlined using LTO while making sure the correct version of LLVM is always used.