summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src
AgeCommit message (Collapse)AuthorLines
2021-03-19Add simd_neg platform intrinsicSparrowLii-0/+1
2021-03-15s/ConstantSource/ConstantKind/Oli Scherer-6/+6
2021-03-12Prepare mir::Constant for ty::Const only supporting valtreesOli Scherer-20/+24
2021-03-10Auto merge of #76570 - cratelyn:implement-rfc-2945-c-unwind-abi, r=Amanieubors-2/+5
Implement RFC 2945: "C-unwind" ABI ## Implement RFC 2945: "C-unwind" ABI This branch implements [RFC 2945]. The tracking issue for this RFC is #74990. The feature gate for the issue is `#![feature(c_unwind)]`. This RFC was created as part of the ffi-unwind project group tracked at rust-lang/lang-team#19. ### Changes Further details will be provided in commit messages, but a high-level overview of the changes follows: * A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`, and `Thiscall` variants, marking whether unwinding across FFI boundaries is acceptable. The cases where each of these variants' `unwind` member is true correspond with the `C-unwind`, `system-unwind`, `stdcall-unwind`, and `thiscall-unwind` ABI strings introduced in RFC 2945 [3]. * This commit adds a `c_unwind` feature gate for the new ABI strings. Tests for this feature gate are included in `src/test/ui/c-unwind/`, which ensure that this feature gate works correctly for each of the new ABIs. A new language features entry in the unstable book is added as well. * We adjust the `rustc_middle::ty::layout::fn_can_unwind` function, used to compute whether or not a `FnAbi` object represents a function that should be able to unwind when `panic=unwind` is in use. * Changes are also made to `rustc_mir_build::build::should_abort_on_panic` so that the function ABI is used to determind whether it should abort, assuming that the `panic=unwind` strategy is being used, and no explicit unwind attribute was provided. [RFC 2945]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
2021-03-09rustc_target: add "unwind" payloads to `Abi`katelyn a. martin-2/+5
### Overview This commit begins the implementation work for RFC 2945. For more information, see the rendered RFC [1] and tracking issue [2]. A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`, and `Thiscall` variants, marking whether unwinding across FFI boundaries is acceptable. The cases where each of these variants' `unwind` member is true correspond with the `C-unwind`, `system-unwind`, `stdcall-unwind`, and `thiscall-unwind` ABI strings introduced in RFC 2945 [3]. ### Feature Gate and Unstable Book This commit adds a `c_unwind` feature gate for the new ABI strings. Tests for this feature gate are included in `src/test/ui/c-unwind/`, which ensure that this feature gate works correctly for each of the new ABIs. A new language features entry in the unstable book is added as well. ### Further Work To Be Done This commit does not proceed to implement the new unwinding ABIs, and is intentionally scoped specifically to *defining* the ABIs and their feature flag. ### One Note on Test Churn This will lead to some test churn, in re-blessing hash tests, as the deleted comment in `src/librustc_target/spec/abi.rs` mentioned, because we can no longer guarantee the ordering of the `Abi` variants. While this is a downside, this decision was made bearing in mind that RFC 2945 states the following, in the "Other `unwind` Strings" section [3]: > More unwind variants of existing ABI strings may be introduced, > with the same semantics, without an additional RFC. Adding a new variant for each of these cases, rather than specifying a payload for a given ABI, would quickly become untenable, and make working with the `Abi` enum prone to mistakes. This approach encodes the unwinding information *into* a given ABI, to account for the future possibility of other `-unwind` ABI strings. ### Ignore Directives `ignore-*` directives are used in two of our `*-unwind` ABI test cases. Specifically, the `stdcall-unwind` and `thiscall-unwind` test cases ignore architectures that do not support `stdcall` and `thiscall`, respectively. These directives are cribbed from `src/test/ui/c-variadic/variadic-ffi-1.rs` for `stdcall`, and `src/test/ui/extern/extern-thiscall.rs` for `thiscall`. This would otherwise fail on some targets, see: https://github.com/rust-lang-ci/rust/commit/fcf697f90206e9c87b39d494f94ab35d976bfc60 ### Footnotes [1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md [2]: https://github.com/rust-lang/rust/issues/74990 [3]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md#other-unwind-abi-strings
2021-03-09Clean up todoskadmin-1/+0
Also add some span_bugs where it is unreachable
2021-03-09Build StKind::CopyOverlappingkadmin-2/+13
This replaces where it was previously being constructed in intrinsics, with direct construction of the Statement.
2021-03-09Update craneliftkadmin-0/+11
2021-03-08Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelixbors-2/+3
Test the effect of shrinking the size of Rvalue by 16 bytes r? `@ghost`
2021-03-05Merge commit '9a0c32934ebe376128230aa8da3275697b2053e7' into ↵bjorn3-2258/+831
sync_cg_clif-2021-03-05
2021-03-05Shrink the size of Rvalue by 16 bytesOli Scherer-2/+3
2021-02-26Rollup merge of #81940 - jhpratt:stabilize-str_split_once, r=m-ou-seGuillaume Gomez-2/+1
Stabilize str_split_once Closes #74773
2021-02-19Use a QueryContext for try_mark_green.Camille GILLOT-5/+1
2021-02-15Use an ItemId inside mir::GlobalAsm.Camille GILLOT-6/+5
2021-02-09Stabilize str_split_onceJacob Pratt-2/+1
2021-02-02Add a new ABI to support cmse_nonsecure_callHugues de Valon-0/+1
This commit adds a new ABI to be selected via `extern "C-cmse-nonsecure-call"` on function pointers in order for the compiler to apply the corresponding cmse_nonsecure_call callsite attribute. For Armv8-M targets supporting TrustZone-M, this will perform a non-secure function call by saving, clearing and calling a non-secure function pointer using the BLXNS instruction. See the page on the unstable book for details. Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2021-02-01Rollup merge of #81618 - bjorn3:sync_cg_clif-2021-02-01, r=bjorn3Jonas Schievink-601/+787
Sync rustc_codegen_cranelift The highlight of this sync are abi compatibility with cg_llvm allowing mixing of cg_clif and cg_llvm compiled crates and switching to the x64 cranelift backend based on the new backend framework. r? ``@ghost`` ``@rustbot`` label +A-codegen +A-cranelift +T-compiler
2021-02-01Merge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into ↵bjorn3-601/+787
sync_cg_clif-2021-02-01
2021-01-29Indicate both start and end of pass RSS in time-passes outputTyson Nottingham-4/+9
Previously, only the end of pass RSS was indicated. This could easily lead one to believe that the change in RSS from one pass to the next was attributable to the second pass, when in fact it occurred between the end of the first pass and the start of the second. Also, improve alignment of columns.
2021-01-29Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obkYuki Okushi-5/+3
clean up some const error reporting around promoteds These are some error reporting simplifications enabled by https://github.com/rust-lang/rust/pull/80579. Further simplifications are possible but could be blocked on making `const_err` a hard error. r? ``````@oli-obk``````
2021-01-24clean up some const error reporting around promotedsRalf Jung-5/+3
2021-01-18Use ty::{IntTy,UintTy,FloatTy} in rustcLeSeulArtichaut-2/+1
2021-01-16codegen_cranelift: Fix redundant semicolon warnÖmer Sinan Ağacan-1/+1
2020-12-27Merge commit 'dbee13661efa269cb4cd57bb4c6b99a19732b484' into ↵bjorn3-231/+425
sync_cg_clif-2020-12-27
2020-12-18Make BoundRegion have a kind of BoungRegionKindJack Huey-1/+1
2020-12-17Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakisbors-11/+13
Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.` r? `@nikomatsakis`
2020-12-16cg_clif: fix build with split dwarfDavid Wood-0/+3
This commit makes minor changes to the cranelift backend so that it can build given changes in cg_ssa for Split DWARF. Signed-off-by: David Wood <david@davidtw.co>
2020-12-11Move binder for dyn to each list itemJack Huey-11/+13
2020-12-09Auto merge of #77611 - oli-obk:atomic_miri_leakage, r=nagisabors-2/+2
Directly use raw pointers in `AtomicPtr` store/load I was unable to find any reason for this limitation in the latest source of LLVM or in the documentation [here](http://llvm.org/docs/Atomics.html#libcalls-atomic). fixes https://github.com/rust-lang/miri/issues/1574
2020-11-29Allow cranelift to handle atomic pointersoli-2/+2
2020-11-27Merge commit '5988bbd24aa87732bfa1d111ba00bcdaa22c481a' into ↵bjorn3-93/+231
sync_cg_clif-2020-11-27
2020-11-16update `cg_clif`Bastian Kauschke-46/+45
2020-11-10Changed unwrap_or to unwrap_or_else in some places.Nicholas-Baron-2/+2
The discussion seems to have resolved that this lint is a bit "noisy" in that applying it in all places would result in a reduction in readability. A few of the trivial functions (like `Path::new`) are fine to leave outside of closures. The general rule seems to be that anything that is obviously an allocation (`Box`, `Vec`, `vec![]`) should be in a closure, even if it is a 0-sized allocation.
2020-11-10Rollup merge of #78875 - petrochenkov:cleantarg, r=Mark-SimulacrumJonas Schievink-8/+8
rustc_target: Further cleanup use of target options Follow up to https://github.com/rust-lang/rust/pull/77729. Implements items 2 and 4 from the list in https://github.com/rust-lang/rust/pull/77729#issue-500228243. The first commit collapses uses of `target.options.foo` into `target.foo`. The second commit renames some target options to avoid tautology: `target.target_endian` -> `target.endian` `target.target_c_int_width` -> `target.c_int_width` `target.target_os` -> `target.os` `target.target_env` -> `target.env` `target.target_vendor` -> `target.vendor` `target.target_family` -> `target.os_family` `target.target_mcount` -> `target.mcount` r? `@Mark-Simulacrum`
2020-11-09Rollup merge of #78674 - tmiasko:inline-substs-for-mir-body, r=oli-obkDylan DPC-7/+5
inliner: Use substs_for_mir_body Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account. Resolves #78529. Resolves #78560.
2020-11-08Collapse all uses of `target.options.foo` into `target.foo`Vadim Petrochenkov-8/+8
with an eye on merging `TargetOptions` into `Target`. `TargetOptions` as a separate structure is mostly an implementation detail of `Target` construction, all its fields logically belong to `Target` and available from `Target` through `Deref` impls.
2020-11-06inliner: Use substs_for_mir_bodyTomasz Miąsko-7/+5
Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account.
2020-11-05Fix even more URLsGuillaume Gomez-1/+1
2020-11-04`u64::try_from` will now fail if `ScalarInt` isn't exactly 64 bits, thus we ↵oli-1/+1
use `to_bits` with the correct size
2020-11-04`u128` truncation and sign extension are not just interpreter relatedoli-4/+1
2020-11-04s/Scalar::Raw/Scalar::Intoli-1/+1
2020-11-04Fix cranelift buildoli-10/+14
2020-11-03Merge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into ↵bjorn3-215/+205
update_cg_clif-2020-11-01
2020-10-26Add 'compiler/rustc_codegen_cranelift/' from commit ↵bjorn3-0/+12118
'793d26047f994e23415f8f6bb5686ff25d3dda92' git-subtree-dir: compiler/rustc_codegen_cranelift git-subtree-mainline: cf798c1ec65a5ec3491846777f9003fabb881b4a git-subtree-split: 793d26047f994e23415f8f6bb5686ff25d3dda92