about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
AgeCommit message (Collapse)AuthorLines
2024-03-05only set noalias on Box with the global allocatorRalf Jung-6/+5
2024-03-04Add a scheme for moving away from `extern "rust-intrinsic"` entirelyOli Scherer-1/+11
2024-02-28Add `f16` and `f128` to `rustc_type_ir::FloatTy` and `rustc_abi::Primitive`Trevor Gross-0/+4
Make changes necessary to support these types in the compiler.
2024-02-27Auto merge of #121635 - 823984418:remove_archive_builder_lifetime_a, ↵bors-1/+1
r=nnethercote Remove useless lifetime of ArchiveBuilder `trait ArchiveBuilder<'a>` has a seemingly useless lifetime a, so I remove it. If this is intentional, please reject this PR. ```rust pub trait ArchiveBuilder<'a> { fn add_file(&mut self, path: &Path); fn add_archive( &mut self, archive: &Path, skip: Box<dyn FnMut(&str) -> bool + 'static>, ) -> io::Result<()>; fn build(self: Box<Self>, output: &Path) -> bool; } ```
2024-02-27Auto merge of #121655 - matthiaskrgr:rollup-qpx3kks, r=matthiaskrgrbors-2/+2
Rollup of 4 pull requests Successful merges: - #121598 (rename 'try' intrinsic to 'catch_unwind') - #121639 (Update books) - #121648 (Update Vec and String `{from,into}_raw_parts`-family docs) - #121651 (Properly emit `expected ;` on `#[attr] expr`) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-27Rollup merge of #121598 - RalfJung:catch_unwind, r=oli-obkMatthias Krüger-2/+2
rename 'try' intrinsic to 'catch_unwind' The intrinsic has nothing to do with `try` blocks, and corresponds to the stable `catch_unwind` function, so this makes a lot more sense IMO. Also rename Miri's special function while we are at it, to reflect the level of abstraction it works on: it's an unwinding mechanism, on which Rust implements panics.
2024-02-26Auto merge of #121516 - RalfJung:platform-intrinsics-begone, r=oli-obkbors-5/+2
remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsics `@Amanieu` `@workingjubilee` I don't think there is any reason these need to be "special"? The [original RFC](https://rust-lang.github.io/rfcs/1199-simd-infrastructure.html) indicated eventually making them stable, but I think that is no longer the plan, so seems to me like we can clean this up a bit. Blocked on https://github.com/rust-lang/stdarch/pull/1538, https://github.com/rust-lang/rust/pull/121542.
2024-02-26remove useless lifetime of ArchiveBuilder823984418-1/+1
2024-02-26rename 'try' intrinsic to 'catch_unwind'Ralf Jung-2/+2
2024-02-25Cranelift: Don't use raw-dylib in stdChris Denton-0/+47
2024-02-25fix use of platform_intrinsics in testsRalf Jung-5/+2
2024-02-25remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsicsRalf Jung-2/+2
2024-02-21remove simd_reduce_{min,max}_nanlessRalf Jung-2/+2
2024-02-21Auto merge of #120718 - saethlin:reasonable-fast-math, r=nnethercotebors-6/+15
Add "algebraic" fast-math intrinsics, based on fast-math ops that cannot return poison Setting all of LLVM's fast-math flags makes our fast-math intrinsics very dangerous, because some inputs are UB. This set of flags permits common algebraic transformations, but according to the [LangRef](https://llvm.org/docs/LangRef.html#fastmath), only the flags `nnan` (no nans) and `ninf` (no infs) can produce poison. And this uses the algebraic float ops to fix https://github.com/rust-lang/rust/issues/120720 cc `@orlp`
2024-02-20Add "algebraic" versions of the fast-math intrinsicsBen Kimock-6/+15
2024-02-18Auto merge of #121034 - obeis:improve-static-mut-ref, r=RalfJungbors-2/+2
Improve wording of `static_mut_ref` Close #120964
2024-02-18Improve wording of static_mut_refObei Sideg-2/+2
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-17Rollup merge of #121209 - nnethercote:infallible-join_codegen, r=bjorn3Matthias Krüger-3/+3
Make `CodegenBackend::join_codegen` infallible. Because they all are, in practice. r? ```@bjorn3```
2024-02-17Make `CodegenBackend::join_codegen` infallible.Nicholas Nethercote-3/+3
Because they all are, in practice.
2024-02-12Give const_deallocate a default bodyOli Scherer-5/+0
2024-02-12Teach llvm backend how to fall back to default bodiesOli Scherer-14/+6
2024-02-12Add intrinsic body fallback to cranelift and use itOli Scherer-35/+32
2024-02-09Auto merge of #120843 - matthiaskrgr:rollup-med37z5, r=matthiaskrgrbors-0/+2
Rollup of 8 pull requests Successful merges: - #113671 (Make privacy visitor use types more (instead of HIR)) - #120308 (core/time: avoid divisions in Duration::new) - #120693 (Invert diagnostic lints.) - #120704 (A drive-by rewrite of `give_region_a_name()`) - #120809 (Use `transmute_unchecked` in `NonZero::new`.) - #120817 (Fix more `ty::Error` ICEs in MIR passes) - #120828 (Fix `ErrorGuaranteed` unsoundness with stash/steal.) - #120831 (Startup objects disappearing from sysroot) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-09Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwcoMatthias Krüger-0/+2
Invert diagnostic lints. That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has been converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted. r? ````@davidtwco````
2024-02-08Add a new debug_assertions instrinsic (compiler)Ben Kimock-0/+9
And in clippy
2024-02-06Invert diagnostic lints.Nicholas Nethercote-0/+2
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-02-05Auto merge of #117372 - Amanieu:stdarch_update, r=Mark-Simulacrumbors-2/+58
Update stdarch submodule Splits up #27731 into multiple tracking issues. Closes #27731
2024-01-30Remove the `abi_amdgpu_kernel` featureclubby789-5/+1
2024-01-30Update ahash dependency to 0.8.7Amanieu d'Antras-2/+58
2024-01-26Merge commit '3e50cf65025f96854d6597e80449b0d64ad89589' into ↵bjorn3-323/+434
sync_cg_clif-2024-01-26
2024-01-25Rebase slice_group_by stabilization PRDavid Tolnay-1/+1
2024-01-26Auto merge of #116167 - RalfJung:structural-eq, r=lcnrbors-3/+0
remove StructuralEq trait The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more. One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust https://github.com/rust-lang/rust/pull/115893 to check for `Eq`, and rule out float matching for good. Fixes https://github.com/rust-lang/rust/issues/115881
2024-01-25Auto merge of #119911 - NCGThompson:is-statically-known, r=oli-obkbors-0/+6
Replacement of #114390: Add new intrinsic `is_var_statically_known` and optimize pow for powers of two This adds a new intrinsic `is_val_statically_known` that lowers to [``@llvm.is.constant.*`](https://llvm.org/docs/LangRef.html#llvm-is-constant-intrinsic).` It also applies the intrinsic in the int_pow methods to recognize and optimize the idiom `2isize.pow(x)`. See #114390 for more discussion. While I have extended the scope of the power of two optimization from #114390, I haven't added any new uses for the intrinsic. That can be done in later pull requests. Note: When testing or using the library, be sure to use `--stage 1` or higher. Otherwise, the intrinsic will be a noop and the doctests will be skipped. If you are trying out edits, you may be interested in [`--keep-stage 0`](https://rustc-dev-guide.rust-lang.org/building/suggested.html#faster-builds-with---keep-stage). Fixes #47234 Resolves #114390 `@Centri3`
2024-01-24remove StructuralEq traitRalf Jung-3/+0
2024-01-23Further Implement `is_val_statically_known`Nicholas Thompson-0/+6
2024-01-22Do not normalize closure signature when building FnOnce shimMichael Goulet-1/+0
2024-01-19Rollup merge of #119815 - nagisa:nagisa/polishes-libloading-use-somewhat, ↵Matthias Krüger-4/+4
r=bjorn3 Format sources into the error message when loading codegen backends cc https://github.com/rust-lang/rustc_codegen_cranelift/issues/1447 cc `@bjorn3`
2024-01-15compiler: Lower fn call arg spans down to MIRMartin Nordholts-72/+77
To enable improved accuracy of diagnostics in upcoming commits.
2024-01-10Format sources into the error message when loading codegen backendsSimonas Kazlauskas-3/+3
cc https://github.com/rust-lang/rustc_codegen_cranelift/issues/1447
2024-01-10deps: deduplicate the version of libloading usedSimonas Kazlauskas-1/+1
The changelog can be found here: https://docs.rs/libloading/latest/libloading/changelog/r0_8_0/index.html
2024-01-09Rollup merge of #117556 - obeis:static-mut-ref-lint, r=davidtwcoGuillaume Gomez-0/+3
Disallow reference to `static mut` and adding `static_mut_ref` lint Closes #114447 r? `@scottmcm`
2024-01-09Rollup merge of #118903 - azhogin:azhogin/skip_second_stmt_debuginfo.rs, ↵Matthias Krüger-9/+1
r=petrochenkov Improved support of collapse_debuginfo attribute for macros. Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain. Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap). cc https://github.com/rust-lang/rust/issues/100758
2024-01-08Improved support of collapse_debuginfo attribute for macros.Andrew Zhogin-9/+1
2024-01-08Use chaining for `DiagnosticBuilder` construction and `emit`.Nicholas Nethercote-3/+4
To avoid the use of a mutable local variable, and because it reads more nicely.
2024-01-07Update test for `E0796` and `static_mut_ref` lintObei Sideg-0/+3
2023-12-31Merge commit '6d355f6844323db03bfd608899613e363e701951' into ↵bjorn3-20/+22
sync_cg_clif-2023-12-31
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-2/+2
2023-12-26Auto merge of #119146 - nnethercote:rm-DiagCtxt-api-duplication, ↵bors-69/+79
r=compiler-errors Remove `DiagCtxt` API duplication `DiagCtxt` defines the internal API for creating and emitting diagnostics: methods like `struct_err`, `struct_span_warn`, `note`, `create_fatal`, `emit_bug`. There are over 50 methods. Some of these methods are then duplicated across several other types: `Session`, `ParseSess`, `Parser`, `ExtCtxt`, and `MirBorrowckCtxt`. `Session` duplicates the most, though half the ones it does are unused. Each duplicated method just calls forward to the corresponding method in `DiagCtxt`. So this duplication exists to (in the best case) shorten chains like `ecx.tcx.sess.parse_sess.dcx.emit_err()` to `ecx.emit_err()`. This API duplication is ugly and has been bugging me for a while. And it's inconsistent: there's no real logic about which methods are duplicated, and the use of `#[rustc_lint_diagnostic]` and `#[track_caller]` attributes vary across the duplicates. This PR removes the duplicated API methods and makes all diagnostic creation and emission go through `DiagCtxt`. It also adds `dcx` getter methods to several types to shorten chains. This approach scales *much* better than API duplication; indeed, the PR adds `dcx()` to numerous types that didn't have API duplication: `TyCtxt`, `LoweringCtxt`, `ConstCx`, `FnCtxt`, `TypeErrCtxt`, `InferCtxt`, `CrateLoader`, `CheckAttrVisitor`, and `Resolver`. These result in a lot of changes from `foo.tcx.sess.emit_err()` to `foo.dcx().emit_err()`. (You could do this with more types, but it gets into diminishing returns territory for types that don't emit many diagnostics.) After all these changes, some call sites are more verbose, some are less verbose, and many are the same. The total number of lines is reduced, mostly because of the removed API duplication. And consistency is increased, because calls to `emit_err` and friends are always preceded with `.dcx()` or `.dcx`. r? `@compiler-errors`
2023-12-24Fix borked subtree syncsbjorn3-256/+33
2023-12-24Merge commit '26c02eb2904da9a53d2220d4f3069b19a3c81d3d' into ↵bjorn3-34/+66
sync_cg_clif-2023-12-24