]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge pull request #1220 from bjorn3/dont_print_on_trap
bjorn3 [Mon, 14 Mar 2022 11:51:47 +0000 (12:51 +0100)]
Merge pull request #1220 from bjorn3/dont_print_on_trap

Replace a lot of print+trap with plain trap

2 years agoReplace a lot of print+trap with plain trap
bjorn3 [Sun, 13 Mar 2022 16:29:25 +0000 (17:29 +0100)]
Replace a lot of print+trap with plain trap

This reduces binary sizes by a decent amount:

libstd.so: 17% reduction
mini_core_hello_world: 27% reduction
simple-raytracer: 27% reduction

This also improves compile time of simple-raytracer by 0.5s (4% +- 2%)
In addition it is also a pre-requisite for building standalone binaries.

2 years agoMark cold blocks
bjorn3 [Sun, 13 Mar 2022 14:51:39 +0000 (15:51 +0100)]
Mark cold blocks

2 years agoUpdate list of ignores rustc tests
bjorn3 [Sun, 13 Mar 2022 17:22:25 +0000 (18:22 +0100)]
Update list of ignores rustc tests

2 years agoAdd and remove some fixmes
bjorn3 [Sun, 13 Mar 2022 14:46:25 +0000 (15:46 +0100)]
Add and remove some fixmes

2 years agoRemove almost all remaining feature gates
bjorn3 [Sun, 13 Mar 2022 14:31:34 +0000 (15:31 +0100)]
Remove almost all remaining feature gates

Only rustc_private is still enabled as cg_clif by definition needs to
use internal rustc api's.

2 years agoRemove decl_macro usage
bjorn3 [Sun, 13 Mar 2022 14:19:48 +0000 (15:19 +0100)]
Remove decl_macro usage

This reduces the amount of unstable features used by cg_clif

2 years agoRustup to rustc 1.61.0-nightly (f103b2969 2022-03-12)
bjorn3 [Sun, 13 Mar 2022 14:04:33 +0000 (15:04 +0100)]
Rustup to rustc 1.61.0-nightly (f103b2969 2022-03-12)

2 years agoSync from rust 4800c7816ee1937d028407066d229f74b4673c92
bjorn3 [Sun, 13 Mar 2022 13:39:10 +0000 (14:39 +0100)]
Sync from rust 4800c7816ee1937d028407066d229f74b4673c92

2 years agoImprove `AdtDef` interning.
Nicholas Nethercote [Fri, 4 Mar 2022 20:28:41 +0000 (07:28 +1100)]
Improve `AdtDef` interning.

This commit makes `AdtDef` use `Interned`. Much the commit is tedious
changes to introduce getter functions. The interesting changes are in
`compiler/rustc_middle/src/ty/adt.rs`.

2 years agoUpdate Cranelift to 0.82.1
bjorn3 [Thu, 10 Mar 2022 13:50:09 +0000 (14:50 +0100)]
Update Cranelift to 0.82.1

This fixes a miscompilation

2 years agoAdd missing clif ir comment
bjorn3 [Wed, 9 Mar 2022 18:33:55 +0000 (19:33 +0100)]
Add missing clif ir comment

2 years agoUpdate dependencies
bjorn3 [Tue, 8 Mar 2022 19:08:50 +0000 (20:08 +0100)]
Update dependencies

2 years agoUpdate Cranelift to 0.82.0
bjorn3 [Tue, 8 Mar 2022 19:01:48 +0000 (20:01 +0100)]
Update Cranelift to 0.82.0

2 years agoFix Box deref for non-ZST allocators
bjorn3 [Tue, 8 Mar 2022 19:00:11 +0000 (20:00 +0100)]
Fix Box deref for non-ZST allocators

2 years agoFix compiletest compilation
bjorn3 [Tue, 8 Mar 2022 11:13:33 +0000 (12:13 +0100)]
Fix compiletest compilation

2 years agoRustup to rustc 1.61.0-nightly (03918badd 2022-03-07)
bjorn3 [Tue, 8 Mar 2022 10:29:17 +0000 (11:29 +0100)]
Rustup to rustc 1.61.0-nightly (03918badd 2022-03-07)

2 years agoSync from rust 67b3e8183830c7af4e06a9aa91de4d1be3c860f7
bjorn3 [Tue, 8 Mar 2022 10:11:51 +0000 (11:11 +0100)]
Sync from rust 67b3e8183830c7af4e06a9aa91de4d1be3c860f7

2 years agoClarify `Layout` interning.
Nicholas Nethercote [Fri, 4 Mar 2022 02:46:56 +0000 (13:46 +1100)]
Clarify `Layout` interning.

`Layout` is another type that is sometimes interned, sometimes not, and
we always use references to refer to it so we can't take any advantage
of the uniqueness properties for hashing or equality checks.

This commit renames `Layout` as `LayoutS`, and then introduces a new
`Layout` that is a newtype around an `Interned<LayoutS>`. It also
interns more layouts than before. Previously layouts within layouts
(via the `variants` field) were never interned, but now they are. Hence
the lifetime on the new `Layout` type.

Unlike other interned types, these ones are in `rustc_target` instead of
`rustc_middle`. This reflects the existing structure of the code, which
does layout-specific stuff in `rustc_target` while `TyAndLayout` is
generic over the `Ty`, allowing the type-specific stuff to occur in
`rustc_middle`.

The commit also adds a `HashStable` impl for `Interned`, which was
needed. It hashes the contents, unlike the `Hash` impl which hashes the
pointer.

2 years agoIntroduce `ConstAllocation`.
Nicholas Nethercote [Tue, 1 Mar 2022 20:15:04 +0000 (07:15 +1100)]
Introduce `ConstAllocation`.

Currently some `Allocation`s are interned, some are not, and it's very
hard to tell at a use point which is which.

This commit introduces `ConstAllocation` for the known-interned ones,
which makes the division much clearer. `ConstAllocation::inner()` is
used to get the underlying `Allocation`.

In some places it's natural to use an `Allocation`, in some it's natural
to use a `ConstAllocation`, and in some places there's no clear choice.
I've tried to make things look as nice as possible, while generally
favouring `ConstAllocation`, which is the type that embodies more
information. This does require quite a few calls to `inner()`.

The commit also tweaks how `PartialOrd` works for `Interned`. The
previous code was too clever by half, building on `T: Ord` to make the
code shorter. That caused problems with deriving `PartialOrd` and `Ord`
for `ConstAllocation`, so I changed it to build on `T: PartialOrd`,
which is slightly more verbose but much more standard and avoided the
problems.

2 years agoFix typo
bjorn3 [Fri, 4 Mar 2022 19:45:04 +0000 (20:45 +0100)]
Fix typo

2 years agorename ErrorReported -> ErrorGuaranteed
mark [Sun, 23 Jan 2022 18:34:26 +0000 (12:34 -0600)]
rename ErrorReported -> ErrorGuaranteed

2 years agoNormalize main return type during mono item collection & codegen
Tomasz Miąsko [Wed, 23 Feb 2022 00:00:00 +0000 (00:00 +0000)]
Normalize main return type during mono item collection & codegen

2 years agoMerge branch 'sync_from_rust'
bjorn3 [Wed, 23 Feb 2022 10:51:21 +0000 (11:51 +0100)]
Merge branch 'sync_from_rust'

2 years agoMerge commit '35d9c6bf256968e1b40e0d554607928bdf9cebea' into sync_cg_clif-2022-02-23
bjorn3 [Wed, 23 Feb 2022 10:49:34 +0000 (11:49 +0100)]
Merge commit '35d9c6bf256968e1b40e0d554607928bdf9cebea' into sync_cg_clif-2022-02-23

2 years agoRustup to rustc 1.61.0-nightly (68369a041 2022-02-22)
bjorn3 [Wed, 23 Feb 2022 10:45:41 +0000 (11:45 +0100)]
Rustup to rustc 1.61.0-nightly (68369a041 2022-02-22)

2 years agoSync from rust bafe8d06e015eb00724d3d497516191d6681943f
bjorn3 [Wed, 23 Feb 2022 10:38:28 +0000 (11:38 +0100)]
Sync from rust bafe8d06e015eb00724d3d497516191d6681943f

2 years agoRustup to rustc 1.61.0-nightly (03a8cc7df 2022-02-21)
bjorn3 [Tue, 22 Feb 2022 19:37:22 +0000 (20:37 +0100)]
Rustup to rustc 1.61.0-nightly (03a8cc7df 2022-02-21)

2 years agoSync from rust 03a8cc7df1d65554a4d40825b0490c93ac0f0236
bjorn3 [Tue, 22 Feb 2022 18:55:24 +0000 (19:55 +0100)]
Sync from rust 03a8cc7df1d65554a4d40825b0490c93ac0f0236

2 years agoRollup merge of #94169 - Amanieu:asm_stuff, r=nagisa
Matthias Krüger [Tue, 22 Feb 2022 11:16:28 +0000 (12:16 +0100)]
Rollup merge of #94169 - Amanieu:asm_stuff, r=nagisa

Fix several asm! related issues

This is a combination of several fixes, each split into a separate commit. Splitting these into PRs is not practical since they conflict with each other.

Fixes #92378
Fixes #85247

r? ``@nagisa``

2 years agoTake CodegenFnAttrs into account when validating asm! register operands
Amanieu d'Antras [Thu, 17 Feb 2022 18:16:04 +0000 (18:16 +0000)]
Take CodegenFnAttrs into account when validating asm! register operands

Checking of asm! register operands now properly takes function
attributes such as #[target_feature] and #[instruction_set] into
account.

2 years agoOn ARM, use relocation_model to detect whether r9 should be reserved
Amanieu d'Antras [Thu, 17 Feb 2022 14:16:52 +0000 (14:16 +0000)]
On ARM, use relocation_model to detect whether r9 should be reserved

The previous approach of checking for the reserve-r9 target feature
didn't actually work because LLVM only sets this feature very late when
initializing the per-function subtarget.

2 years agouse `List<Ty<'tcx>>` for tuples
lcnr [Mon, 7 Feb 2022 15:06:31 +0000 (16:06 +0100)]
use `List<Ty<'tcx>>` for tuples

2 years agoUpdate ignored rustc tests list
bjorn3 [Sun, 20 Feb 2022 16:03:47 +0000 (17:03 +0100)]
Update ignored rustc tests list

2 years agoRustup to rustc 1.61.0-nightly (3b348d932 2022-02-19)
bjorn3 [Sun, 20 Feb 2022 15:28:22 +0000 (16:28 +0100)]
Rustup to rustc 1.61.0-nightly (3b348d932 2022-02-19)

2 years agoMove ty::print methods to Drop-based scope guards
Mark Rousskov [Wed, 16 Feb 2022 18:04:48 +0000 (13:04 -0500)]
Move ty::print methods to Drop-based scope guards

2 years agoRustup to rustc 1.60.0-nightly (09cb29c64 2022-02-15)
bjorn3 [Wed, 16 Feb 2022 11:43:07 +0000 (12:43 +0100)]
Rustup to rustc 1.60.0-nightly (09cb29c64 2022-02-15)

2 years agoSync from rust a240ccd81c74c105b6f5fe84c46f8d36edb7e306
bjorn3 [Wed, 16 Feb 2022 11:14:53 +0000 (12:14 +0100)]
Sync from rust a240ccd81c74c105b6f5fe84c46f8d36edb7e306

2 years agoOverhaul `Const`.
Nicholas Nethercote [Wed, 2 Feb 2022 03:24:45 +0000 (14:24 +1100)]
Overhaul `Const`.

Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as
this:
```
pub struct Const<'tcx>(&'tcx Interned<ConstS>);
```
This now matches `Ty` and `Predicate` more closely, including using
pointer-based `eq` and `hash`.

Notable changes:
- `mk_const` now takes a `ConstS`.
- `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a
  we need separate arena for it, because we can't use the `Dropless` one any
  more.
- Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes
- Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes.
- Lots of tedious sigil fiddling.

2 years agoOverhaul `RegionKind` and `Region`.
Nicholas Nethercote [Fri, 28 Jan 2022 00:25:15 +0000 (11:25 +1100)]
Overhaul `RegionKind` and `Region`.

Specifically, change `Region` from this:
```
pub type Region<'tcx> = &'tcx RegionKind;
```
to this:
```
pub struct Region<'tcx>(&'tcx Interned<RegionKind>);
```

This now matches `Ty` and `Predicate` more closely.

Things to note
- Regions have always been interned, but we haven't been using pointer-based
  `Eq` and `Hash`. This is now happening.
- I chose to impl `Deref` for `Region` because it makes pattern matching a lot
  nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`.
- Various methods are moved from `RegionKind` to `Region`.
- There is a lot of tedious sigil changes.
- A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a
  `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`.
- A couple of test outputs change slightly, I'm not sure why, but the new
  outputs are a little better.

2 years agoOverhaul `TyS` and `Ty`.
Nicholas Nethercote [Tue, 25 Jan 2022 03:13:38 +0000 (14:13 +1100)]
Overhaul `TyS` and `Ty`.

Specifically, change `Ty` from this:
```
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
```
to this
```
pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>);
```
There are two benefits to this.
- It's now a first class type, so we can define methods on it. This
  means we can move a lot of methods away from `TyS`, leaving `TyS` as a
  barely-used type, which is appropriate given that it's not meant to
  be used directly.
- The uniqueness requirement is now explicit, via the `Interned` type.
  E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather
  than via `TyS`, which wasn't obvious at all.

Much of this commit is boring churn. The interesting changes are in
these files:
- compiler/rustc_middle/src/arena.rs
- compiler/rustc_middle/src/mir/visit.rs
- compiler/rustc_middle/src/ty/context.rs
- compiler/rustc_middle/src/ty/mod.rs

Specifically:
- Most mentions of `TyS` are removed. It's very much a dumb struct now;
  `Ty` has all the smarts.
- `TyS` now has `crate` visibility instead of `pub`.
- `TyS::make_for_test` is removed in favour of the static `BOOL_TY`,
  which just works better with the new structure.
- The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls
  of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned`
  (pointer-based, for the `Equal` case) and partly on `TyS`
  (contents-based, for the other cases).
- There are many tedious sigil adjustments, i.e. adding or removing `*`
  or `&`. They seem to be unavoidable.

2 years agoRustup to rustc 1.60.0-nightly (5d8767cb2 2022-02-12)
bjorn3 [Sun, 13 Feb 2022 11:24:02 +0000 (12:24 +0100)]
Rustup to rustc 1.60.0-nightly (5d8767cb2 2022-02-12)

2 years agoSync from rust 9a60099cc43c8a07abb280be323d1ed9afc27f2c
bjorn3 [Sun, 13 Feb 2022 10:57:51 +0000 (11:57 +0100)]
Sync from rust 9a60099cc43c8a07abb280be323d1ed9afc27f2c

2 years agoUnconditionally update symbols
bjorn3 [Thu, 10 Feb 2022 17:27:18 +0000 (18:27 +0100)]
Unconditionally update symbols

All paths to an ArchiveBuilder::build call update_symbols first.

2 years agoMake FnAbiError Copy.
Camille GILLOT [Tue, 1 Feb 2022 17:44:45 +0000 (18:44 +0100)]
Make FnAbiError Copy.

2 years agoEnsure that queries only return Copy types.
Camille GILLOT [Mon, 31 Jan 2022 18:55:34 +0000 (19:55 +0100)]
Ensure that queries only return Copy types.

2 years agoUpdate Cranelift to 0.81.0
bjorn3 [Tue, 8 Feb 2022 17:24:50 +0000 (18:24 +0100)]
Update Cranelift to 0.81.0

2 years agoDon't try to reinstall ripgrep if it is already installed
bjorn3 [Sun, 6 Feb 2022 14:13:29 +0000 (15:13 +0100)]
Don't try to reinstall ripgrep if it is already installed

2 years agoRustup to rustc 1.60.0-nightly (88fb06a1f 2022-02-05)
bjorn3 [Sun, 6 Feb 2022 13:50:12 +0000 (14:50 +0100)]
Rustup to rustc 1.60.0-nightly (88fb06a1f 2022-02-05)

2 years agoMerge codegen of a couple more simd intrinsics
bjorn3 [Sun, 30 Jan 2022 18:44:15 +0000 (19:44 +0100)]
Merge codegen of a couple more simd intrinsics

2 years agoMerge codegen of several simd intrinsics
bjorn3 [Sun, 30 Jan 2022 18:37:01 +0000 (19:37 +0100)]
Merge codegen of several simd intrinsics

This reduces code duplication

2 years agoRemove the remaining simd intrinsic macros
bjorn3 [Sun, 30 Jan 2022 18:31:18 +0000 (19:31 +0100)]
Remove the remaining simd intrinsic macros

2 years agoRemove simd_cmp macro
bjorn3 [Sun, 30 Jan 2022 18:19:54 +0000 (19:19 +0100)]
Remove simd_cmp macro

This reduces duplication in the codegened source file

2 years agoFix simd type validation
bjorn3 [Sun, 30 Jan 2022 17:35:08 +0000 (18:35 +0100)]
Fix simd type validation

2 years agoRemove validate_atomic_type
bjorn3 [Sun, 30 Jan 2022 17:23:01 +0000 (18:23 +0100)]
Remove validate_atomic_type

By expanding it in place. Also extract a common
report_atomic_type_validation_error function to reduce code duplication.

2 years agoDon't generate unnecessary let $arg=$arg for intrinsics
bjorn3 [Sun, 30 Jan 2022 17:00:36 +0000 (18:00 +0100)]
Don't generate unnecessary let $arg=$arg for intrinsics

2 years agoRemove some unused lint allows
bjorn3 [Sun, 30 Jan 2022 16:43:09 +0000 (17:43 +0100)]
Remove some unused lint allows

2 years agoAdd const_allocate and const_deallocate intrinsics
bjorn3 [Sun, 30 Jan 2022 16:26:53 +0000 (17:26 +0100)]
Add const_allocate and const_deallocate intrinsics

2 years agoUpdate dependencies
bjorn3 [Sun, 30 Jan 2022 15:57:30 +0000 (16:57 +0100)]
Update dependencies

2 years agoRustup to rustc 1.60.0-nightly (a00e130da 2022-01-29)
bjorn3 [Sun, 30 Jan 2022 15:52:18 +0000 (16:52 +0100)]
Rustup to rustc 1.60.0-nightly (a00e130da 2022-01-29)

2 years agoSync from rust a00e130dae74a213338e2b095ec855156d8f3d8a
bjorn3 [Sun, 30 Jan 2022 12:25:57 +0000 (13:25 +0100)]
Sync from rust a00e130dae74a213338e2b095ec855156d8f3d8a

2 years agoUse an `indexmap` to avoid sorting `LocalDefId`s
pierwill [Thu, 6 Jan 2022 19:27:59 +0000 (13:27 -0600)]
Use an `indexmap` to avoid sorting `LocalDefId`s

Update `indexmap` to 1.8.0.

Bless test

2 years agoRustfmt
bjorn3 [Wed, 19 Jan 2022 15:38:58 +0000 (16:38 +0100)]
Rustfmt

2 years agoImplement unchecked_mul intrinsic
bjorn3 [Wed, 19 Jan 2022 14:45:04 +0000 (15:45 +0100)]
Implement unchecked_mul intrinsic

2 years agoRustup to rustc 1.60.0-nightly (9ad5d82f8 2022-01-18)
bjorn3 [Wed, 19 Jan 2022 14:36:14 +0000 (15:36 +0100)]
Rustup to rustc 1.60.0-nightly (9ad5d82f8 2022-01-18)

2 years agoSync from rust 2f004d2d401682e553af3984ebd9a3976885e752
bjorn3 [Wed, 19 Jan 2022 14:26:05 +0000 (15:26 +0100)]
Sync from rust 2f004d2d401682e553af3984ebd9a3976885e752

2 years agoremove `is_noop`
lcnr [Wed, 19 Jan 2022 09:33:23 +0000 (10:33 +0100)]
remove `is_noop`

2 years agoSplit compile_fn out of codegen_fn
bjorn3 [Tue, 18 Jan 2022 18:07:26 +0000 (19:07 +0100)]
Split compile_fn out of codegen_fn

2 years agoPass only the Function to write_clif_file
bjorn3 [Tue, 18 Jan 2022 17:58:37 +0000 (18:58 +0100)]
Pass only the Function to write_clif_file

2 years agoRecord object file artifact size in self profile data
bjorn3 [Tue, 18 Jan 2022 14:24:11 +0000 (15:24 +0100)]
Record object file artifact size in self profile data

2 years agoUpdate rustc test ignore list
bjorn3 [Tue, 18 Jan 2022 12:59:40 +0000 (13:59 +0100)]
Update rustc test ignore list

2 years agoUse 2021 edition for libcore tests
bjorn3 [Tue, 18 Jan 2022 12:41:01 +0000 (13:41 +0100)]
Use 2021 edition for libcore tests

2 years agoRustup to rustc 1.60.0-nightly (ee5d8d37b 2022-01-17)
bjorn3 [Tue, 18 Jan 2022 12:02:02 +0000 (13:02 +0100)]
Rustup to rustc 1.60.0-nightly (ee5d8d37b 2022-01-17)

2 years agoSync from rust 7531d2fdd49966d83830a7b4596c95587b1e9573
bjorn3 [Tue, 18 Jan 2022 11:49:50 +0000 (12:49 +0100)]
Sync from rust 7531d2fdd49966d83830a7b4596c95587b1e9573

2 years agoPass target_features set instead of has_feature closure
bjorn3 [Mon, 10 Jan 2022 14:48:05 +0000 (15:48 +0100)]
Pass target_features set instead of has_feature closure

This avoids unnecessary monomorphizations in codegen backends

2 years agoUse Symbol for target features in asm handling
bjorn3 [Mon, 10 Jan 2022 14:32:45 +0000 (15:32 +0100)]
Use Symbol for target features in asm handling

This saves a couple of Symbol::intern calls

2 years agoAuto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieu
bors [Mon, 17 Jan 2022 09:40:29 +0000 (09:40 +0000)]
Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieu

Remove deprecated LLVM-style inline assembly

The `llvm_asm!` was deprecated back in #87590 1.56.0, with intention to remove
it once `asm!` was stabilized, which already happened in #91728 1.59.0. Now it
is time to remove `llvm_asm!` to avoid continued maintenance cost.

Closes #70173.
Closes #92794.
Closes #87612.
Closes #82065.

cc `@rust-lang/wg-inline-asm`

r? `@Amanieu`

2 years agoinitial revert
Ellen [Wed, 12 Jan 2022 03:19:52 +0000 (03:19 +0000)]
initial revert

2 years agoRemove deprecated LLVM-style inline assembly
Tomasz Miąsko [Wed, 12 Jan 2022 00:00:00 +0000 (00:00 +0000)]
Remove deprecated LLVM-style inline assembly

2 years agoStore a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`
Aaron Hill [Mon, 3 Jan 2022 03:37:05 +0000 (22:37 -0500)]
Store a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`

The field is also renamed from `ident` to `name. In most cases,
we don't actually need the `Span`. A new `ident` method is added
to `VariantDef` and `FieldDef`, which constructs the full `Ident`
using `tcx.def_ident_span()`. This method is used in the cases
where we actually need an `Ident`.

This makes incremental compilation properly track changes
to the `Span`, without all of the invalidations caused by storing
a `Span` directly via an `Ident`.

2 years agoAdd y.bin to clean_all.sh
bjorn3 [Mon, 10 Jan 2022 11:26:23 +0000 (12:26 +0100)]
Add y.bin to clean_all.sh

2 years agoUpdate to Cranelift 0.80.0
bjorn3 [Mon, 10 Jan 2022 11:26:03 +0000 (12:26 +0100)]
Update to Cranelift 0.80.0

2 years agoMove most code from y.rs to build_system/mod.rs
bjorn3 [Sun, 9 Jan 2022 18:30:07 +0000 (19:30 +0100)]
Move most code from y.rs to build_system/mod.rs

y.rs can't be rustfmt'ed without making it no longer be a valid bash
script.

2 years agoMerge pull request #1216 from bjorn3/reduce_cg_clif_compile_times
bjorn3 [Sun, 9 Jan 2022 18:25:10 +0000 (19:25 +0100)]
Merge pull request #1216 from bjorn3/reduce_cg_clif_compile_times

Refactor the intrinsics module for slightly better build times

2 years agoPass Ty instead of TyAndLayout to the closure of various simd helpers
bjorn3 [Sun, 9 Jan 2022 18:07:15 +0000 (19:07 +0100)]
Pass Ty instead of TyAndLayout to the closure of various simd helpers

This reduces the total amount of llvm ir lines for simd related
functions from 9604 to 9467.

2 years agoDon't monomorphize the simd helpers for each closure
bjorn3 [Sun, 9 Jan 2022 17:55:57 +0000 (18:55 +0100)]
Don't monomorphize the simd helpers for each closure

This halves the total amount of llvm ir lines for simd related functions
from 18227 to 9604.

2 years agoReturn Value instead of CValue from the simd_for_each_lane closure
bjorn3 [Sun, 9 Jan 2022 17:43:08 +0000 (18:43 +0100)]
Return Value instead of CValue from the simd_for_each_lane closure

2 years agoUse simplified version of bool_to_zero_or_max_uint in simd_cmp
bjorn3 [Sun, 9 Jan 2022 17:32:27 +0000 (18:32 +0100)]
Use simplified version of bool_to_zero_or_max_uint in simd_cmp

2 years agoSlightly simplify some macros by removing an extra case for when signedness doesn...
bjorn3 [Sun, 9 Jan 2022 16:44:55 +0000 (17:44 +0100)]
Slightly simplify some macros by removing an extra case for when signedness doesn't matter

This is slightly more verbose when invoking the macro.

2 years agoRemove support for vector icmp for now
bjorn3 [Sun, 9 Jan 2022 16:39:00 +0000 (17:39 +0100)]
Remove support for vector icmp for now

Real simd support will need an overhaul in the future anyway. For now it
only complicates the code.

2 years agoMove a couple of macros to intrinsics::simd
bjorn3 [Sun, 9 Jan 2022 16:34:55 +0000 (17:34 +0100)]
Move a couple of macros to intrinsics::simd

2 years agoMove validate_simd_type from intrinsics to intrinsics::simd
bjorn3 [Sun, 9 Jan 2022 16:30:01 +0000 (17:30 +0100)]
Move validate_simd_type from intrinsics to intrinsics::simd

2 years agoTurn validate_simd_type into a function
bjorn3 [Sun, 9 Jan 2022 16:29:16 +0000 (17:29 +0100)]
Turn validate_simd_type into a function

This effectively outlines it, significantly reducing the size of
the codegen_simd_intrinsic_call llvm ir from 10419 lines to 6378 lines.

2 years agoRemove the call_intrinsic_match macro
bjorn3 [Sun, 9 Jan 2022 16:22:23 +0000 (17:22 +0100)]
Remove the call_intrinsic_match macro

2 years agoDedup codegen_operand calls in codegen_float_intrinsic_call
bjorn3 [Sun, 9 Jan 2022 16:19:11 +0000 (17:19 +0100)]
Dedup codegen_operand calls in codegen_float_intrinsic_call

This reduces the amount of llvm ir lines for this function by a little
over half from 1662 to 781.

2 years agoDedup write_cvalue calls in codegen_float_intrinsic_call
bjorn3 [Sun, 9 Jan 2022 16:11:28 +0000 (17:11 +0100)]
Dedup write_cvalue calls in codegen_float_intrinsic_call

Also directly use an array instead of going through a tuple. This
reduces the amount of llvm ir lines for this function by almost half
from 3086 to 1662.

2 years agoMove call_intrinsic_match macro into codegen_float_intrinsic_call
bjorn3 [Sun, 9 Jan 2022 15:44:54 +0000 (16:44 +0100)]
Move call_intrinsic_match macro into codegen_float_intrinsic_call

2 years agoOnly use a single bug!() invocation in call_intrinsic_match
bjorn3 [Sun, 9 Jan 2022 14:31:44 +0000 (15:31 +0100)]
Only use a single bug!() invocation in call_intrinsic_match

This reduces code size

2 years agoRemove unnecessary argument
bjorn3 [Sun, 9 Jan 2022 14:24:10 +0000 (15:24 +0100)]
Remove unnecessary argument

2 years agoRemove a couple of duplicate calls
bjorn3 [Sun, 9 Jan 2022 14:22:46 +0000 (15:22 +0100)]
Remove a couple of duplicate calls