Commit Graph

1084 Commits

Author SHA1 Message Date
bjorn3 73d3a1c14a Use dynamic dispatch for the inner Module
This improves compilation time and shrinks the linked backend from
13MB to 9.7MB on Linux.
2021-02-23 18:49:37 +01:00
bjorn3 013b3c5a7c Rustfmt 2021-02-21 17:03:21 +01:00
bjorn3 4eb6754749 Sync from rust 3e826bb112 2021-02-21 17:02:04 +01:00
bjorn3 ecba16f296 Various enum to int cast fixes 2021-02-21 16:52:42 +01:00
bjorn3 7fc34839ac Revert "Remove shift amount masking"
This reverts commit c5f98b586f.

It turns out to be necessary anyway
2021-02-21 16:51:40 +01:00
bjorn3 0610490c8d Assume constants can't fail to evaluate
See rust-lang/rust#81327 for the same change to cg_llvm
2021-02-21 13:58:56 +01:00
bjorn3 74f39b64c8 Avoid a temporary stackslot in codegen_checked_int_binop 2021-02-21 12:48:43 +01:00
bjorn3 b0f870edd6 Fix CI 2021-02-21 12:34:30 +01:00
bjorn3 ee36a1fbb1 Remove workaround for stack_{load,store}.i128 not being implemented 2021-02-21 12:18:43 +01:00
bjorn3 9c980276d8 Directly use Cranelift instructions for 128bit int shifts 2021-02-21 12:09:13 +01:00
bjorn3 c5f98b586f Remove shift amount masking
Unlike the old x75 backend, the new x64 backend masks the shift amount
itself, matching the specified semantics.
2021-02-21 12:03:02 +01:00
bjorn3 a8f3877c36 Don't write clif ir by default when debug assertions are enabled 2021-02-21 10:42:31 +01:00
bjorn3 25f7eeec46 Don't import the metadata symbol
Helps with #1134
2021-02-21 10:40:30 +01:00
bjorn3 4cfb885da7 Merge pull request #1140 from bjorn3/no_more_oldbe
Remove support for the old x86 Cranelift backend
2021-02-21 10:13:37 +01:00
bjorn3 92c1b858ef Disable stack2reg optimization
It causes a miscompilation of lewton

Fixes #1142
2021-02-20 16:55:30 +01:00
Camille GILLOT 702676bfff Use a QueryContext for try_mark_green. 2021-02-19 17:51:56 +01:00
bjorn3 f2f5452089 Use real atomic instructions instead of a global lock 2021-02-18 18:14:21 +01:00
bjorn3 92f765fce9 Remove support for x86 oldBE 2021-02-18 18:07:25 +01:00
Camille GILLOT fe8d11bb99 Use an ItemId inside mir::GlobalAsm. 2021-02-15 19:24:58 +01:00
bjorn3 658d12408b Rustfmt 2021-02-12 15:40:08 +00:00
bjorn3 94aac0af59 Pass around BackendConfig 2021-02-12 15:39:58 +00:00
bjorn3 c5dff34ae9 Revert "Update libc and libloading"
This reverts commit bfcf97bd83.

It causes a "can't resolve symbol" crash on macOS
2021-02-09 13:19:19 +01:00
bjorn3 bfcf97bd83 Update libc and libloading 2021-02-09 12:40:43 +01:00
bjorn3 f36c14f0a6 Sync from rust f4008fe949 2021-02-09 12:21:17 +01:00
bjorn3 decb9b2880 Rustfmt 2021-02-03 12:21:22 +01:00
bjorn3 0f861e1035 Update Cranelift 2021-02-03 11:53:23 +01:00
Hugues de Valon 5bdc56c00c Add a new ABI to support cmse_nonsecure_call
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-02 13:04:31 +00:00
bjorn3 e4ae9ef3b0 Rustup to rustc 1.51.0-nightly (d4e3570db 2021-02-01) 2021-02-02 10:24:29 +01:00
Jonas Schievink 02e1fd48d1 Rollup merge of #81618 - bjorn3:sync_cg_clif-2021-02-01, r=bjorn3
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-01 14:29:47 +01:00
bjorn3 a75f9bc3be Merge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into sync_cg_clif-2021-02-01 2021-02-01 10:11:46 +01:00
Tyson Nottingham 2b8f2acd5f Indicate both start and end of pass RSS in time-passes output
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-29 12:46:29 -08:00
Yuki Okushi e67b72de2e Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk
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-29 09:17:38 +09:00
Ralf Jung d6eb4f571e clean up some const error reporting around promoteds 2021-01-24 13:34:34 +01:00
LeSeulArtichaut c3d7dc93dc Use ty::{IntTy,UintTy,FloatTy} in rustc 2021-01-18 21:09:30 +01:00
Ömer Sinan Ağacan ea73caa3b7 codegen_cranelift: Fix redundant semicolon warn 2021-01-16 07:17:13 +03:00
bjorn3 77f74ed070 Merge commit 'dbee13661efa269cb4cd57bb4c6b99a19732b484' into sync_cg_clif-2020-12-27 2020-12-27 10:30:38 +01:00
Jack Huey 6c1fc324b2 Make BoundRegion have a kind of BoungRegionKind 2020-12-18 15:27:28 -05:00
bors a921a476c8 Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakis
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-17 18:21:20 +00:00
David Wood 5f6c32af15 cg_clif: fix build with split dwarf
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-16 10:33:48 +00:00
Jack Huey 42b267d221 Move binder for dyn to each list item 2020-12-11 15:02:46 -05:00
bors aec0fc58ad Auto merge of #77611 - oli-obk:atomic_miri_leakage, r=nagisa
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-12-09 19:53:23 +00:00
oli 7760894d3f Allow cranelift to handle atomic pointers 2020-11-29 14:56:19 +00:00
bjorn3 d404840788 Merge commit '5988bbd24aa87732bfa1d111ba00bcdaa22c481a' into sync_cg_clif-2020-11-27 2020-11-27 20:48:53 +01:00
Bastian Kauschke 56e63805be update cg_clif 2020-11-16 22:42:09 +01:00
Nicholas-Baron a5ec85758b Changed unwrap_or to unwrap_or_else in some places.
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-10 20:07:47 -08:00
Jonas Schievink 65ae469f8d Rollup merge of #78875 - petrochenkov:cleantarg, r=Mark-Simulacrum
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-10 14:45:21 +01:00
Dylan DPC 806538fa78 Rollup merge of #78674 - tmiasko:inline-substs-for-mir-body, r=oli-obk
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-09 01:13:42 +01:00
Vadim Petrochenkov e9c34b3cf8 Collapse all uses of target.options.foo into target.foo
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-08 17:29:13 +03:00
Tomasz Miąsko f7e11cba36 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.
2020-11-06 00:00:00 +00:00
Guillaume Gomez d6f457d835 Fix even more URLs 2020-11-05 20:11:29 +01:00