Commit Graph

3246 Commits

Author SHA1 Message Date
bjorn3
a465d6a860 Move codegen_and_compile_fn to driver/jit.rs 2023-02-03 16:48:35 +00:00
bjorn3
21bdff8bc0 Fix transmute from vector to scalar pair again 2023-02-01 15:28:06 +01:00
bjorn3
78bf4af659 Fix hyperfine install on CI 2023-02-01 13:58:05 +00:00
bjorn3
df04fd6fba Don't force many scalar pair values to the stack in write_cvalue_maybe_transmute
Sometimes it is necessary for handling vector to scalar pair transmutes,
but if the types are the same there is no need for this.

This improves runtime performance on simple-raytracer by 12%.
2023-02-01 13:55:28 +00:00
bjorn3
79f4cc0822 Run y.rs bench in CI 2023-01-31 18:14:54 +00:00
bjorn3
d1024b6560 Fix y.rs bench 2023-01-31 17:44:29 +00:00
bjorn3
572e32b4cd Fix rustc test suite 2023-01-31 17:39:19 +00:00
bors
ba7bb62e25 Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk
Use stable metric for const eval limit instead of current terminator-based logic

This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only.

The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made).

Also see: #103877
2023-01-29 04:11:27 +00:00
bjorn3
3ba9b13490 Don't download abi-cafe and simple-raytracer in ./y.rs prepare
Instead download them on the fly
2023-01-27 18:44:19 +00:00
bors
7ef46c8bab Auto merge of #107055 - kylematsuda:eb-fn-sig, r=lcnr
Switch to `EarlyBinder` for `fn_sig` query

Part of the work to finish #105779 (also see https://github.com/rust-lang/types-team/issues/78).

Several queries `X` have a `bound_X` variant that wraps the output in [`EarlyBinder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html). This adds `EarlyBinder` to the return type of the `fn_sig` query and removes `bound_fn_sig`.

r? `@lcnr`
2023-01-27 15:02:44 +00:00
bjorn3
e24fa2f915 Rustup to rustc 1.69.0-nightly (d7948c843 2023-01-26) 2023-01-27 12:43:49 +01:00
bjorn3
56cb727734 Sync from rust 18890f05f6 2023-01-27 12:36:10 +01:00
Kyle Matsuda
21575908c6 add EarlyBinder::no_bound_vars 2023-01-26 20:28:31 -07:00
Kyle Matsuda
7bb0bfea04 change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add EarlyBinder to fn_sig in metadata 2023-01-26 20:28:25 -07:00
Kyle Matsuda
a88ec47d48 replace usages of fn_sig query with bound_fn_sig 2023-01-26 20:15:36 -07:00
bors
02d5f7fa4d Auto merge of #107269 - bjorn3:sync_cg_clif-2023-01-24, r=bjorn3
Sync rustc_codegen_cranelift

For cg_clif itself there have been a couple of bug fixes since the last sync, a Cranelift update and implemented all remaining simd platform intrinsics used by `std::simd`. (`std::arch` still misses a lot though) Most of the diff is from reworking of the cg_clif build system though.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2023-01-27 00:03:09 +00:00
bors
3ac370b890 Auto merge of #107314 - matthiaskrgr:rollup-j40lnlj, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #106407 (Improve proc macro attribute diagnostics)
 - #106960 (Teach parser to understand fake anonymous enum syntax)
 - #107085 (Custom MIR: Support binary and unary operations)
 - #107086 (Print PID holding bootstrap build lock on Linux)
 - #107175 (Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`)
 - #107204 (suggest qualifying bare associated constants)
 - #107248 (abi: add AddressSpace field to Primitive::Pointer )
 - #107272 (Implement ObjectSafe and WF in the new solver)
 - #107285 (Implement `Generator` and `Future` in the new solver)
 - #107286 (ICE in new solver if we see an inference variable)
 - #107313 (Add Style Team Triagebot config)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-26 06:23:14 +00:00
bors
801b1a1919 Auto merge of #105582 - saethlin:instcombine-assert-inhabited, r=cjgillot
InstCombine away intrinsic validity assertions

This optimization (currently) fires 246 times on the standard library. It seems to fire hardly at all on the big crates in the benchmark suite. Interesting.
2023-01-26 03:10:52 +00:00
bjorn3
ff56716d03 Fix CI 2023-01-25 16:27:28 +01:00
bjorn3
89e90ede57 Vendor newer version of cranelift-native
It fixes a bug that caused compilation on 32bit x86 to fail
2023-01-25 15:19:40 +01:00
bjorn3
b67610f98a Merge commit '598f0909568a51de8a2d1148f55a644fd8dffad0' into sync_cg_clif-2023-01-24 2023-01-24 18:56:42 +01:00
Ben Kimock
39b34dc792 Thread a ParamEnv down to might_permit_raw_init 2023-01-23 19:25:10 -05:00
Bryan Garza
706d7ff108 Update codegen cranelift for ConstEvalCounter 2023-01-23 23:56:22 +00:00
Erik Desjardins
ef5ec771bb abi: add AddressSpace field to Primitive::Pointer
...and remove it from `PointeeInfo`, which isn't meant for this.

There are still various places (marked with FIXMEs) that assume all pointers
have the same size and alignment. Fixing this requires parsing non-default
address spaces in the data layout string, which will be done in a followup.
2023-01-22 23:41:39 -05:00
bjorn3
598f090956 Update to Cranelift 0.92 2023-01-20 18:52:58 +00:00
bjorn3
6eef214e46 Separate out abi-cafe runs into separate CI jobs
This increases build parallelism
2023-01-20 17:49:59 +00:00
bjorn3
219cdbaac0 Fix clif ir writing for simd_gather 2023-01-20 17:40:53 +00:00
bjorn3
c6ad186298 Use panic_nounwind and panic_cannot_unwind where necessary
These were either regular unwinding panics or aborts in the past but got
changed somewhat recently.
2023-01-20 17:27:39 +00:00
bjorn3
6c58be8e51 Fix rustc test suite 2023-01-20 15:35:50 +00:00
bjorn3
fb6d048c4d Update patch 2023-01-20 12:49:27 +01:00
bjorn3
92b4c76652 Update rustup.sh for the moved dir of the sysroot source 2023-01-20 12:41:27 +01:00
bjorn3
7d14e606be Rustup to rustc 1.68.0-nightly (4c83bd03a 2023-01-19) 2023-01-20 12:40:54 +01:00
bjorn3
954dfd1198 Sync from rust 56ee85274e 2023-01-20 12:22:21 +01:00
bjorn3
4e87f13054 Fix a couple of TOCTOU occurences 2023-01-19 15:58:40 +00:00
bors
739938d7a8 Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkov
Various cleanups around pre-TyCtxt queries and functions

part of #105462

based on https://github.com/rust-lang/rust/pull/106776 (everything starting at [0e2b39f](0e2b39fd1f) is new in this PR)

r? `@petrochenkov`

I think this should be most of the uncontroversial part of #105462.
2023-01-19 05:23:40 +00:00
Maybe Waffle
49a9438681 Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
Oli Scherer
08c7230989 Move compiler input and ouput paths into session 2023-01-16 14:46:44 +00:00
bjorn3
7095783268 Only run abi-cafe on cg_clif's CI 2023-01-16 11:21:37 +00:00
bjorn3
611c5184ce
Merge pull request #1341 from bjorn3/build_sysroot_cleanup
Refactor sysroot building
2023-01-15 20:36:09 +01:00
bjorn3
0f4df8fb0e Eliminate a couple of extra calls
This is an additional 17% improvement on ./y.rs compile --sysroot none

Benchmark 1: ./y_before.bin build --sysroot none
  Time (mean ± σ):      1.533 s ±  0.022 s    [User: 1.411 s, System: 0.471 s]
  Range (min … max):    1.517 s …  1.589 s    10 runs

Benchmark 2: ./y_after.bin build --sysroot none
  Time (mean ± σ):      1.311 s ±  0.020 s    [User: 1.232 s, System: 0.428 s]
  Range (min … max):    1.298 s …  1.366 s    10 runs

Summary
  './y_after.bin build --sysroot none' ran
    1.17 ± 0.02 times faster than './y_before.bin build --sysroot none'
2023-01-15 15:20:36 +00:00
bjorn3
abcff71bec Significantly speed up assembling of sysroots
By avoiding some redundant rustc calls and stripping debuginfo for
wrappers. ./y.rs build --sysroot none now runs 44% faster.

Benchmark 1: ./y_before.bin build --sysroot none
  Time (mean ± σ):      2.200 s ±  0.038 s    [User: 2.140 s, System: 0.653 s]
  Range (min … max):    2.171 s …  2.303 s    10 runs

Benchmark 2: ./y_after.bin build --sysroot none
  Time (mean ± σ):      1.528 s ±  0.020 s    [User: 1.388 s, System: 0.490 s]
  Range (min … max):    1.508 s …  1.580 s    10 runs

Summary
  './y_after.bin build --sysroot none' ran
    1.44 ± 0.03 times faster than './y_before.bin build --sysroot none'
2023-01-15 14:14:13 +00:00
bjorn3
13197322ec Skip creating sysroot target dir if it will be empty 2023-01-14 18:45:47 +00:00
bjorn3
280dffd82c Build rtstartup for none sysroot too
Even mini_core needs it
2023-01-14 18:41:22 +00:00
bjorn3
fd83b27945 Port llvm sysroot building to SysrootTarget too and dedup some code 2023-01-14 18:25:43 +00:00
bjorn3
0ac4456351 Move rtstartup build to build_clif_sysroot_for_triple
Also pass build/rtstartup as sysroot when building the standard library
2023-01-14 17:51:54 +00:00
bjorn3
6f1e1775d3 Introduce SysrootTarget 2023-01-14 17:40:16 +00:00
bjorn3
c950f2265e Build rtstartup for MinGW from scratch
Rather than copying it from an existing sysroot
2023-01-14 17:02:21 +00:00
bjorn3
b31b74e8fb
Merge pull request #1340 from bjorn3/non_rustup_build
Push up a lot of rustc and cargo references
2023-01-14 16:45:25 +01:00
bjorn3
629eab79c1 Avoid hard-coded rustc when building wrappers 2023-01-14 14:18:11 +00:00
bjorn3
22c5249f68 Don't hard-code rustc path in get_rustc_version and get_default_sysroot 2023-01-14 14:18:11 +00:00