about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
AgeCommit message (Collapse)AuthorLines
2025-07-25Use the object crate rather than LLVM for extracting bitcode sectionsbjorn3-34/+0
2025-07-20Rollup merge of #144116 - nikic:llvm-21-fixes, r=dianqkMatthias Krüger-1/+4
Fixes for LLVM 21 This fixes compatibility issues with LLVM 21 without performing the actual upgrade. Split out from https://github.com/rust-lang/rust/pull/143684. This fixes three issues: * Updates the AMDGPU data layout for address space 8. * Makes emit-arity-indicator.rs a no_core test, so it doesn't fail on non-x86 hosts. * Explicitly sets the exception model for wasm, as this is no longer implied by `-wasm-enable-eh`.
2025-07-19Rollup merge of #142444 - KMJ-007:autodiff-codegen-test, r=ZuseZ4Matthias Krüger-0/+13
adding run-make test to autodiff r? `@ZuseZ4`
2025-07-18Pass wasm exception model to TargetOptionsNikita Popov-1/+4
This is no longer implied by -wasm-enable-eh.
2025-07-02awhile -> a while where appropriateнаб-1/+1
2025-07-02fix: Fix TypePrintFn flag passing for autodiff codegenKaran Janthe-0/+13
Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-05-01PassWrapper: adapt for ↵Erick Tryzelaar-0/+5
llvm/llvm-project@f137c3d592e96330e450a8fd63ef7e8877fc1908 In LLVM 21 PR https://github.com/llvm/llvm-project/pull/130940 `TargetRegistry::createTargetMachine` was changed to take a `const Triple&` and has deprecated the old `StringRef` method. @rustbot label llvm-main
2025-04-28PassWrapper: adapt for llvm/llvm-project@d3d856ad8469Augie Fackler-4/+9
LLVM 21 moves to making it more explicit what this function call is doing, but nothing has changed behaviorally, so for now we just adjust to using the new name of the function. @rustbot label llvm-main
2025-04-12fix LooseTypes flag and PrintMod behaviour, add debug helperManuel Drehwald-2/+28
2025-04-05Update the minimum external LLVM to 19Josh Stone-44/+14
2025-03-31PassWrapper: adapt for ↵Augie Fackler-4/+9
llvm/llvm-project@94122d58fc77079a291a3d008914006cb509d9db We also have to remove the LLVM argument in cast-target-abi.rs for LLVM 21. I'm not really sure what the best approach here is since that test already uses revisions. We could also fork the test into a copy for LLVM 19-20 and another for LLVM 21, but what I did for now was drop the lint-abort-on-error flag to LLVM figuring that some coverage was better than none, but I'm happy to change this if that was a bad direction. The above also applies for ffi-out-of-bounds-loads.rs. r? dianqk @rustbot label llvm-main
2025-03-12Adapt to LLVM dropping CfiFunctionIndex::begin()/end()Hans Wennborg-0/+9
After https://github.com/llvm/llvm-project/pull/130382, RustWrapper needs to call CfiFunctionIndex::symbols() instead.
2025-03-06[llvm/PassWrapper] use `size_t` when building arg stringsJosh Stone-5/+5
2025-02-23The embedded bitcode should always be prepared for LTO/ThinLTODianQK-16/+50
2025-02-21update enzyme submodule and usersManuel Drehwald-3/+6
2025-02-14Quote embedded codeview command line argumentsNikita Popov-8/+12
The formatting of the command line arguments has been moved to the frontend in: https://github.com/llvm/llvm-project/commit/e190d074a0a77c9f8a7d7938a8187a7e2076e290 However, the Rust logic introduced in https://github.com/rust-lang/rust/commit/ad0ecebf432fcb80cb666034ea44f75b81e55f95 did not replicate the previous argument quoting behavior.
2025-02-10move second opt run to lto phase and cleanup codeManuel Drehwald-3/+8
2025-02-07fix non-enzyme buildsManuel Drehwald-7/+10
2025-02-07get tests to work without -Z/-C flagsManuel Drehwald-0/+10
2025-01-07llvm: Ignore error value that is always falseMatthew Maurer-8/+2
See llvm/llvm-project#121851 For LLVM 20+, this function (`renameModuleForThinLTO`) has no return value. For prior versions of LLVM, this never failed, but had a signature which allowed an error value people were handling.
2024-12-30rustc_llvm: expose FloatABIType target machine parameterRalf Jung-5/+21
2024-11-26Respect verify-llvm-ir option in the backendNikita Popov-3/+3
We are currently unconditionally verifying the LLVM IR in the backend (twice), ignoring the value of the verify-llvm-ir option.
2024-11-14PassWrapper: disable UseOdrIndicator for Asan Win32Jakob Koschel-4/+11
As described here UseOdrIndicator should be disabled on Windows since link.exe does not support duplicate weak definitions (https://reviews.llvm.org/D137227). Co-Authored-By: Bastian Kersting <bkersting@google.com>
2024-11-09Auto merge of #132584 - Zalathar:includes, r=cuviperbors-19/+18
Trim and tidy includes in `rustc_llvm` These includes tend to accumulate over time, and are usually only removed when something breaks in a new LLVM version, so it's nice to clean them up manually once in a while. General strategy used for this PR: - Remove all includes from `LLVMWrapper.h` that aren't needed by the header itself, transplanting them to individual source files as necessary. - For each source file, temporarily remove each include if doing so doesn't cause a compile error. - If a “required” include looks like it shouldn't be needed, try replacing it with its sub-includes, then trim that list. - After doing all of the above, go back and re-add any removed include if the file does actually use things defined in that header, even if the header happens to also be included by something else.
2024-11-08Don't use `LLVMRustStringWriteImpl` outside of `RawRustStringOstream`Zalathar-1/+2
2024-11-05PassWrapper: adapt for new parameter in LLVMAugie Fackler-5/+41
llvm/llvm-project@390300d9f41df6ad71f0f4196ef4885d4bd5dc48 added a new parameter to some callbacks, so we have to handle them. @rustbot label: +llvm-main
2024-11-04Trim and tidy includes in `rustc_llvm`Zalathar-19/+18
2024-11-03Auto merge of #132555 - matthiaskrgr:rollup-2d79661, r=matthiaskrgrbors-7/+6
Rollup of 15 pull requests Successful merges: - #129329 (Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`) - #131377 (Add LowerExp and UpperExp implementations to NonZero) - #132393 (Docs: added brief colon explanation) - #132437 (coverage: Regression test for inlining into an uninstrumented crate) - #132499 (unicode_data.rs: show command for generating file) - #132503 (better test for const HashMap; remove const_hash leftovers) - #132511 (stabilize const_arguments_as_str) - #132520 (NFC add known bug nr to test) - #132522 (make codegen help output more consistent) - #132523 (Added regression test for generics index out of bounds) - #132528 (Use `*_opt` typeck results fns to not ICE in fallback suggestion) - #132537 (PassWrapper: adapt for llvm/llvm-project@5445edb5d) - #132540 (Do not format generic consts) - #132543 (add and update some crashtests) - #132550 (compiler: Continue introducing rustc_abi to the compiler) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-03Auto merge of #132514 - Zalathar:print-target-cpus, r=jieyouxubors-41/+9
Port most of `--print=target-cpus` to Rust The logic and formatting needed by `--print=target-cpus` has historically been carried out in C++ code. Originally it used `printf` to write directly to the console, but later it switched over to writing to a `std::ostringstream` and then passing its buffer to a callback function pointer. This PR replaces that C++ code with a very simple function that writes a list of CPU names to a `&RustString`, with the rest of the logic and formatting being handled by ordinary safe Rust code.
2024-11-03Rollup merge of #132537 - durin42:llvm-20-prelinklto, r=DianQKMatthias Krüger-7/+6
PassWrapper: adapt for llvm/llvm-project@5445edb5d As with ab5583ed1e75869b765a90386dac9119992f8ed7, we had been explicitly passing defaults whose type have changed. Rather than do an ifdef, we simply rely on the defaults. ````@rustbot```` label: +llvm-main
2024-11-03Auto merge of #132419 - durin42:llvm-20-type-test-thing, r=cuviperbors-3/+3
PassWrapper: adapt for llvm/llvm-project@b01e2a8b5620466c3b A boolean turned into an enum. None matches the old behavior of false, so we pass that. `@rustbot` label: +llvm-main
2024-11-02PassWrapper: adapt for llvm/llvm-project@5445edb5dAugie Fackler-7/+6
As with ab5583ed1e75869b765a90386dac9119992f8ed7, we had been explicitly passing defaults whose type have changed. Rather than do an ifdef, we simply rely on the defaults. @rustbot label: +llvm-main
2024-11-02PassWrapper: adapt for ↵Augie Fackler-3/+3
llvm/llvm-project@b01e2a8b5620466c3b80cc6f049efbc90b9d103a We don't see a reason to explicitly pass the default here, so just use the default instead of explicitly passing it and needing an ifdef. @rustbot label: +llvm-main
2024-11-02Port most of `LLVMRustPrintTargetCPUs` to RustZalathar-39/+7
2024-11-02Use a dedicated safe wrapper for `LLVMRustGetHostCPUName`Zalathar-2/+2
2024-10-31Remove support for `-Zprofile` (gcov-style coverage instrumentation)Zalathar-11/+2
2024-10-30Consistently use safe wrapper function `set_section`Zalathar-2/+4
2024-10-29correct LLVMRustCreateThinLTOData arg typesklensy-4/+4
2024-10-16clang-formatArthur Eubanks-2/+2
2024-10-16rustc_llvm: Fix flattened CLI argsArthur Eubanks-2/+2
Fixes string manipulation errors introduced in #130446.
2024-09-25Pass Module Analysis Manager to Standard InstrumentationsAleksei Romanov-5/+6
2024-09-22Auto merge of #130446 - durin42:llvm-20-fix-CommandLineArgs, r=workingjubileebors-1/+19
rustc_llvm: adapt to flattened CLI args in LLVM This changed in llvm/llvm-project@e190d074a0a77c9f8a7d7938a8187a7e2076e290. I decided to stick with more duplication between the ifdef blocks to make the code easier to read for the next two years before we can plausibly drop LLVM 19. `@rustbot` label: +llvm-main try-job: x86_64-msvc
2024-09-18Update the minimum external LLVM to 18Josh Stone-38/+4
2024-09-18llvm-wrapper: adapt for LLVM API changes, second tryKrasimir Georgiev-0/+4
2024-09-17Rollup merge of #130477 - tmandry:revert-llvm-20-lto, r=tmandryMatthias Krüger-7/+3
Revert #129749 to fix segfault in LLVM This reverts commit 8c7a7e346be4cdf13e77ab4acbfb5ade819a4e60, reversing changes made to a00bd75b6c5c96d0a35afa2dc07ce3155112d278. Reported in https://github.com/rust-lang/rust/pull/129749#issuecomment-2354417960. `@nikic's` theory is that the LLVM API changed in a way that makes it impossible to use concurrently from multiple threads (https://github.com/llvm/llvm-project/pull/106427#issuecomment-2354783802). I pinged `@krasimirgg` who was fine with reverting. r? `@rust-lang/wg-llvm`
2024-09-16Revert "Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikic"Tyler Mandry-7/+3
This reverts commit 8c7a7e346be4cdf13e77ab4acbfb5ade819a4e60, reversing changes made to a00bd75b6c5c96d0a35afa2dc07ce3155112d278.
2024-09-16PassWrapper: clang-format has spokenAugie Fackler-1/+2
2024-09-16rustc_llvm: adapt to flattened CLI args in LLVMAugie Fackler-1/+18
This changed in llvm/llvm-project@e190d074a0a77c9f8a7d7938a8187a7e2076e290. I decided to stick with more duplication between the ifdef blocks to make the code easier to read for the next two years before we can plausibly drop LLVM 19. @rustbot label: +llvm-main
2024-09-16rustc_llvm: update for ↵Augie Fackler-1/+0
llvm/llvm-project@2ae968a0d9fb61606b020e898d884c82dd0ed8b5 Just a simple header move. @rustbot label: +llvm-main
2024-08-31Rollup merge of #129749 - krasimirgg:llvm-20-lto, r=nikicMatthias Krüger-3/+7
llvm-wrapper: adapt for LLVM API changes No functional changes intended. Updates the wrapper for https://github.com/5c4lar/llvm-project/commit/21eddfac3d75879b3e0b09c5bc848526dcab6ab0. ````@rustbot```` label: +llvm-main r? ````@nikic````