about summary refs log tree commit diff
path: root/compiler/rustc_llvm
AgeCommit message (Collapse)AuthorLines
2025-03-13Rollup merge of #138420 - zmodem:cfifunctionindex_fix, r=durin42Matthias Krüger-0/+9
Adapt to LLVM dropping CfiFunctionIndex::begin()/end() After https://github.com/llvm/llvm-project/pull/130382, RustWrapper needs to call CfiFunctionIndex::symbols() instead.
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-11Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-3/+1
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). This breakage was reported in <https://github.com/rust-lang/rust/issues/138304>. This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-09Rollup merge of #138084 - nnethercote:workspace-lints, r=jieyouxuMatthias Krüger-1/+3
Use workspace lints for crates in `compiler/` This is nicer and hopefully less error prone than specifying lints via bootstrap. r? ``@jieyouxu``
2025-03-07Rollup merge of #138137 - ZequanWu:fix-triple, r=cuviperJacob Pratt-2/+6
setTargetTriple now accepts Triple rather than string https://github.com/llvm/llvm-project/pull/129868 updated `setTargetTriple`
2025-03-08Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
(Except for `rustc_codegen_cranelift`.) It's no longer necessary now that `unreachable_pub` is in the workspace lints.
2025-03-08Specify rust lints for `compiler/` crates via Cargo.Nicholas Nethercote-0/+3
By naming them in `[workspace.lints.rust]` in the top-level `Cargo.toml`, and then making all `compiler/` crates inherit them with `[lints] workspace = true`. (I omitted `rustc_codegen_{cranelift,gcc}`, because they're a bit different.) The advantages of this over the current approach: - It uses a standard Cargo feature, rather than special handling in bootstrap. So, easier to understand, and less likely to get accidentally broken in the future. - It works for proc macro crates. It's a shame it doesn't work for rustc-specific lints, as the comments explain.
2025-03-06rename Triple to TargetZequan Wu-3/+3
2025-03-06setTargetTriple now accepts Triple rather than stringZequan Wu-0/+4
2025-03-06[llvm/PassWrapper] use `size_t` when building arg stringsJosh Stone-5/+5
2025-03-04promote ohos targets to tier to with host toolsLuuuXXX-1/+2
2025-03-01Auto merge of #133250 - DianQK:embed-bitcode-pgo, r=nikicbors-16/+50
The embedded bitcode should always be prepared for LTO/ThinLTO Fixes #115344. Fixes #117220. There are currently two methods for generating bitcode that used for LTO. One method involves using `-C linker-plugin-lto` to emit object files as bitcode, which is the typical setting used by cargo. The other method is through `-C embed-bitcode=yes`. When using with `-C embed-bitcode=yes -C lto=no`, we run a complete non-LTO LLVM pipeline to obtain bitcode, then the bitcode is used for LTO. We run the Call Graph Profile Pass twice on the same module. This PR is doing something similar to LLVM's `buildFatLTODefaultPipeline`, obtaining the bitcode for embedding after running `buildThinLTOPreLinkDefaultPipeline`. r? nikic
2025-02-28compiler: bump `cc` to 1.2.16 to fix `x86` Windows jobs on newest Windows SDK许杰友 Jieyou Xu (Joe)-1/+1
See <https://github.com/rust-lang/rust/issues/137733>.
2025-02-24Auto merge of #137271 - nikic:gep-nuw-2, r=scottmcmbors-0/+18
Emit getelementptr inbounds nuw for pointer::add() Lower pointer::add (via intrinsic::offset with unsigned offset) to getelementptr inbounds nuw on LLVM versions that support it. This lets LLVM make use of the pre-condition that the offset addition does not wrap in an unsigned sense. Together with inbounds, this also implies that the offset is non-negative. Fixes https://github.com/rust-lang/rust/issues/137217.
2025-02-23The embedded bitcode should always be prepared for LTO/ThinLTODianQK-16/+50
2025-02-22Auto merge of #137420 - matthiaskrgr:rollup-rr0q37f, r=matthiaskrgrbors-3/+7
Rollup of 9 pull requests Successful merges: - #136910 (Implement feature `isolate_most_least_significant_one` for integer types) - #137183 (Prune dead regionck code) - #137333 (Use `edition = "2024"` in the compiler (redux)) - #137356 (Ferris 🦀 Identifier naming conventions) - #137362 (Add build step log for `run-make-support`) - #137377 (Always allow reusing cratenum in CrateLoader::load) - #137388 (Fix(lib/fs/tests): Disable rename POSIX semantics FS tests under Windows 7) - #137410 (Use StableHasher + Hash64 for dep_tracking_hash) - #137413 (jubilee cleared out the review queue) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-21update enzyme submodule and usersManuel Drehwald-3/+6
2025-02-22Fix overcapturing, unsafe extern blocks, and new unsafe opsMichael Goulet-2/+6
2025-02-22Upgrade the compiler to edition 2024Michael Goulet-1/+1
2025-02-19Switch to the LLVMBuildGEPWithNoWrapFlags APINikita Popov-0/+18
This API allows us to set the nuw flag as well.
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-10Rollup merge of #136419 - EnzymeAD:autodiff-tests, r=onur-ozkan,jieyouxuMatthias Krüger-2/+24
adding autodiff tests I'd like to get started with upstreaming some tests, even though I'm still waiting for an answer on how to best integrate the enzyme pass. Can we therefore temporarily support the -Z llvm-plugins here without too much effort? And in that case, how would that work? I saw you can do remapping, e.g. `rust-src-base`, but I don't think that will give me the path to libEnzyme.so. Do you have another suggestion? Other than that this test simply checks that the derivative of `x*x` is `2.0 * x`, which in this case is computed as `%0 = fadd fast double %x.0.val, %x.0.val` (I'll add a few more tests and move it to an autodiff folder if we can use the -Z flag) r? ``@jieyouxu`` Locally at least `-Zllvm-plugins=${PWD}/build/x86_64-unknown-linux-gnu/enzyme/build/Enzyme/libEnzyme-19.so` seems to work if I copy the command I get from x.py test and run it manually. However, running x.py test itself fails. Tracking: - https://github.com/rust-lang/rust/issues/124509 Zulip discussion: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Enzyme.20build.20changes
2025-02-10Rollup merge of #136707 - clubby789:cmake-bisect, r=jieyouxuJubilee-1/+1
Bump `cc` to v1.2.13 for the compiler workspace
2025-02-10Bump `cc` to v1.2.13 for the compiler workspaceclubby789-1/+1
2025-02-10move second opt run to lto phase and cleanup codeManuel Drehwald-3/+12
2025-02-07fix non-enzyme buildsManuel Drehwald-7/+10
2025-02-07get tests to work without -Z/-C flagsManuel Drehwald-0/+10
2025-02-06Remove dead code from rustc_codegen_llvm and the LLVM wrapperDaniel Paoliello-31/+0
2025-02-01Use `LLVMDIBuilderCreateDebugLocation`Zalathar-10/+0
The LLVM-C binding takes an explicit context, whereas our binding obtained the context from the scope argument.
2025-02-01Use `LLVMDIBuilderCreateLexicalBlockFile`Zalathar-6/+0
2025-02-01Use `LLVMDIBuilderCreateLexicalBlock`Zalathar-8/+0
2025-02-01Use `LLVMDIBuilderCreateNameSpace`Zalathar-8/+0
2025-02-01Use `LLVMDIBuilderFinalize`Zalathar-4/+0
2025-01-31Auto merge of #136350 - matthiaskrgr:rollup-6eqfyvh, r=matthiaskrgrbors-106/+101
Rollup of 9 pull requests Successful merges: - #134531 ([rustdoc] Add `--extract-doctests` command-line flag) - #135860 (Compiler: Finalize dyn compatibility renaming) - #135992 (Improve documentation when adding a new target) - #136194 (Support clobber_abi in BPF inline assembly) - #136325 (Delay a bug when indexing unsized slices) - #136326 (Replace our `LLVMRustDIBuilderRef` with LLVM-C's `LLVMDIBuilderRef`) - #136330 (Remove unnecessary hooks) - #136336 (Overhaul `rustc_middle::util`) - #136341 (Remove myself from vacation) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Rollup merge of #136326 - Zalathar:llvm-di-builder-ref, r=nikicMatthias Krüger-106/+101
Replace our `LLVMRustDIBuilderRef` with LLVM-C's `LLVMDIBuilderRef` Inspired by trying to split #134009 into smaller steps that are easier to review individually. This makes it possible to start incrementally replacing our debuginfo bindings with the ones in the LLVM-C API, all of which operate on `LLVMDIBuilderRef`. There should be no change to compiler behaviour.
2025-01-31Auto merge of #136332 - jhpratt:rollup-aa69d0e, r=jhprattbors-3/+2
Rollup of 9 pull requests Successful merges: - #132156 (When encountering unexpected closure return type, point at return type/expression) - #133429 (Autodiff Upstreaming - rustc_codegen_ssa, rustc_middle) - #136281 (`rustc_hir_analysis` cleanups) - #136297 (Fix a typo in profile-guided-optimization.md) - #136300 (atomic: extend compare_and_swap migration docs) - #136310 (normalize `*.long-type.txt` paths for compare-mode tests) - #136312 (Disable `overflow_delimited_expr` in edition 2024) - #136313 (Filter out RPITITs when suggesting unconstrained assoc type on too many generics) - #136323 (Fix a typo in conventions.md) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Remove the temporary typedef for `LLVMRustDIFlags`Zalathar-16/+10
If we're already churning all of the debuginfo bindings, we might as well fix this at the same time.
2025-01-31Replace our `LLVMRustDIBuilderRef` with LLVM-C's `LLVMDIBuilderRef`Zalathar-90/+91
This makes it possible to start incrementally replacing our debuginfo bindings with the ones in the LLVM-C API, all of which operate on `LLVMDIBuilderRef`.
2025-01-30use Attribute::getWithCaptureInfoHans Wennborg-2/+1
2025-01-30LLVM changed the nocapture attribute to captures(none)Hans Wennborg-0/+11
This updates RustWrapper.cpp and tests after https://github.com/llvm/llvm-project/pull/123181
2025-01-29upstream rustc_codegen_ssa/rustc_middle changes for enzyme/autodiffManuel Drehwald-3/+2
2025-01-21Make our `DIFlags` match `LLVMDIFlags` in the LLVM-C APIZalathar-114/+68
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.
2025-01-05Use constants for DWARF opcodes, instead of FFI callsZalathar-12/+4
2025-01-04Auto merge of #133990 - Walnut356:static_const, r=workingjubileebors-0/+7
[Debuginfo] Force enum `DISCR_*` to `static const u64` to allow for inspection via LLDB see [here](https://rust-lang.zulipchat.com/#narrow/channel/317568-t-compiler.2Fwg-debugging/topic/Revamping.20Debuginfo/near/486614878) for more info. This change mainly helps `*-msvc` debugged with LLDB. Currently, LLDB cannot inspect `static` struct fields, so the intended visualization for enums is only borderline functional, and niche enums with ranges of discriminant cannot be determined at all . LLDB *can* inspect `static const` values (though for whatever reason, non-enum/non-u64 consts don't work). This change adds the `LLVMRustDIBuilderCreateQualifiedType` to the rust FFI layer to wrap the discr type with a `const` modifier, as well as forcing all generated integer enum `DISCR_*` values to be u64's. Those values will only ever be used by debugger visualizers anyway, so it shouldn't be a huge deal, but I left a fixme comment for it just in case.. The `tag` also still properly reflects the discriminant type, so no information is lost.
2025-01-03Bump cc in the compilerChris Denton-1/+1
2025-01-01upstream rustc_codegen_llvm changes for enzyme/autodiffManuel Drehwald-0/+77
2024-12-30force enum `DISCR_*` to `const u64` to allow for inspection via LLDB's ↵Walnut-3/+3
`SBTypeStaticField::GetConstantValue()`
2024-12-30rustc_llvm: expose FloatABIType target machine parameterRalf Jung-5/+21