Commit Graph

83 Commits

Author SHA1 Message Date
Veera
d2aa91054b Add a Few Codegen Tests 2024-11-02 05:33:56 +00:00
Ralf Jung
56ee492a6e move strict provenance lints to new feature gate, remove old feature gates 2024-10-21 15:22:17 +01:00
clubby789
aa299a9bdf Add codegen test for branchy bool match 2024-10-19 10:05:25 +00:00
Josh Stone
5365b3f7be Avoid superfluous UB checks in IndexRange
`IndexRange::len` is justified as an overall invariant, and
`take_prefix` and `take_suffix` are justified by local branch
conditions. A few more UB-checked calls remain in cases that are only
supported locally by `debug_assert!`, which won't do anything in
distributed builds, so those UB checks may still be useful.

We generally expect core's `#![rustc_preserve_ub_checks]` to optimize
away in user's release builds, but the mere presence of that extra code
can sometimes inhibit optimization, as seen in #131563.
2024-10-11 16:22:43 -07:00
Jörn Horstmann
e393f56d37 Improve autovectorization of to_lowercase / to_uppercase functions
Refactor the code in the `convert_while_ascii` helper function to make
it more suitable for auto-vectorization and also process the full ascii
prefix of the string. The generic case conversion logic will only be
invoked starting from the first non-ascii character.

The runtime on microbenchmarks with ascii-only inputs improves between
1.5x for short and 4x for long inputs on x86_64 and aarch64.

The new implementation also encapsulates all unsafe inside the
`convert_while_ascii` function.

Fixes #123712
2024-09-23 11:31:29 +02:00
Jubilee Young
ff3a9f4e2a tests: Remove spuriously failing vec-tryinto-array codegen test 2024-09-22 16:46:10 -07:00
Guillaume Gomez
bf6389f077
Rollup merge of #128209 - beetrees:no-macos-10.10, r=jieyouxu
Remove macOS 10.10 dynamic linker bug workaround

Rust's current minimum macOS version is 10.12, so the hack can be removed. This PR also updates the `remove_dir_all` docs to reflect that all supported macOS versions are protected against TOCTOU race conditions (the fallback implementation was already removed in #127683).

try-job: dist-x86_64-apple
try-job: dist-aarch64-apple
try-job: dist-apple-various
try-job: aarch64-apple
try-job: x86_64-apple-1
2024-09-20 19:46:37 +02:00
Josh Stone
6fd8a50680 Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
beetrees
0444056aa3
Remove macOS 10.10 dynamic linker bug workaround 2024-09-04 13:13:48 +01:00
The 8472
f3bc08adbd ignore/fix layout-sensitive tests 2024-08-31 23:56:45 +02:00
Matthias Krüger
85180cd365
Rollup merge of #128759 - notriddle:notriddle/spec-to-string, r=workingjubilee,compiler-errors
alloc: add ToString specialization for `&&str`

Fixes #128690
2024-08-14 05:05:51 +02:00
bors
e08b80c0fb Auto merge of #128371 - andjo403:rangeAttribute, r=nikic
Add range attribute to scalar function results and arguments

as LLVM 19 adds the range attribute this starts to use it for better optimization.
hade been interesting to see a perf run with the https://github.com/rust-lang/rust/pull/127513

closes https://github.com/rust-lang/rust/issues/50156
cc https://github.com/rust-lang/rust/issues/49572 shall be fixed but not possible to see as there is asserts that already trigger the optimization.
2024-08-12 10:20:00 +00:00
Andreas Jonson
cfadfabfcd Add range attribute to scalar function results and arguments 2024-08-11 19:40:44 +02:00
bors
69b380dc1c Auto merge of #128584 - DianQK:tests-for-llvm-19, r=nikic
Add a set of tests for LLVM 19

Close #107681. Close #118306. Close #126585.

r? compiler
2024-08-10 01:59:54 +00:00
DianQK
b5c453d7a2
Add a set of tests for LLVM 19 2024-08-08 18:08:44 +08:00
Michael Howell
1b587a6e76 alloc: add ToString specialization for &&str
Fixes #128690
2024-08-06 14:37:33 -07:00
clubby789
8497800abd Add test for updating enum discriminant through pointer 2024-08-03 16:41:49 +00:00
klensy
b90ee2a51a reenable some windows tests 2024-07-14 13:48:29 +03:00
bors
c6727fc9b5 Auto merge of #123351 - beetrees:x86-ret-snan-rust, r=nikic,workingjubilee
Ensure floats are returned losslessly by the Rust ABI on 32-bit x86

Solves #115567 for the (default) `"Rust"` ABI. When compiling for 32-bit x86, this PR changes the `"Rust"` ABI to return floats indirectly instead of in x87 registers (with the exception of single `f32`s, which this PR returns in general purpose registers as they are small enough to fit in one). No change is made to the `"C"` ABI as that ABI requires x87 register usage and therefore will need a different solution.
2024-07-12 20:36:43 +00:00
beetrees
cae9d480bf
Adjust tests for x86 "Rust" ABI changes 2024-07-12 10:47:56 +01:00
Scott McMurray
4236da52af Give inlining bonuses to things that optimize out 2024-06-19 21:35:37 -07:00
bors
7ac6c2fc68 Auto merge of #125347 - tesuji:needtests, r=nikic
Add codegen tests for E-needs-test

close #36010
close #68667
close #74938
close #83585
close #93036
close #109328
close #110797
close #111508
close #112509
close #113757
close #120440
close #118392
close #71096

r? nikic
2024-06-14 13:40:52 +00:00
Nikita Popov
26fa5c2c30 Make issue-122805.rs big endian compatible
Instead of not generating the function at all on big endian (which
makes the CHECK lines fail), instead use to_le() on big endian,
so that we essentially perform a bswap for both endiannesses.
2024-06-11 16:07:14 +02:00
Lzu Tao
ab0f87ec66 Fix tests for 32 bits targets 2024-06-11 07:45:16 +00:00
Lzu Tao
f9edd864df Apply suggestions from code review
Co-authored-by: Nikita Popov <github@npopov.com>
2024-06-09 13:25:12 +00:00
Lzu Tao
95740fbfed add codegen test for #36010 2024-06-09 07:35:24 +00:00
Lzu Tao
5f527eb562 add codegen test for #68667 2024-06-09 07:35:24 +00:00
Lzu Tao
bf178187c7 add codegen test for #74938 2024-06-09 07:35:24 +00:00
Lzu Tao
8bd6c04cfc add codegen test for #93036 2024-06-09 07:35:24 +00:00
Lzu Tao
7d967ffa8d add codegen test for #109328 2024-06-09 07:35:24 +00:00
Lzu Tao
ddb94dbd16 add codegen test for #110797 2024-06-09 07:35:24 +00:00
Lzu Tao
15d07fb2cb Add codegen test for #111508 2024-06-09 07:35:24 +00:00
Lzu Tao
beabc5647b add codegen test for #112509 2024-06-09 07:35:24 +00:00
Lzu Tao
f37c576dbd add codegen test for #113757 2024-06-09 07:35:24 +00:00
Lzu Tao
f3c89f1751 add codegen test for issue-118392, 71096 2024-06-09 07:35:24 +00:00
Nicholas Nethercote
72800d3b89 Run rustfmt on tests/codegen/.
Except for `simd-intrinsic/`, which has a lot of files containing
multiple types like `u8x64` which really are better when hand-formatted.

There is a surprising amount of two-space indenting in this directory.

Non-trivial changes:
- `rustfmt::skip` needed in `debug-column.rs` to preserve meaning of the
  test.
- `rustfmt::skip` used in a few places where hand-formatting read more
  nicely: `enum/enum-match.rs`
- Line number adjustments needed for the expected output of
  `debug-column.rs` and `coroutine-debug.rs`.
2024-05-31 15:56:43 +10:00
Mads Marquart
e6b9bb7b72 Make more of the test suite run on Mac Catalyst
This adds the `only-apple`/`ignore-apple` compiletest directive, and
uses that basically everywhere instead of `only-macos`/`ignore-macos`.

Some of the updates in `run-make` are a bit redundant, as they use
`ignore-cross-compile` and won't run on iOS - but using Apple in these
is still more correct, so I've made that change anyhow.
2024-05-28 12:31:33 +02:00
Gary Guo
cfee72aa24 Fix tests and bless 2024-04-24 13:12:33 +01:00
bors
29a56a3b1c Auto merge of #122053 - erikdesjardins:alloca, r=nikic
Stop using LLVM struct types for alloca

The alloca type has no semantic meaning, only the size (and alignment, but we specify it explicitly) matter. Using `[N x i8]` is a more direct way to specify that we want `N` bytes, and avoids relying on LLVM's struct layout. It is likely that a future LLVM version will change to an untyped alloca representation.

Split out from #121577.

r? `@ghost`
2024-04-24 03:00:44 +00:00
Markus Reiter
33e68aadc9
Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
Erik Desjardins
daaaacdcb3 remove alloca type from issue-105386-ub-in-debuginfo
It's irrelevant for the purposes of this test (there is only one alloca)
and its size changes depending on the target, so it can't be matched
easily.
2024-04-12 08:36:22 -04:00
Erik Desjardins
f4426c189f use [N x i8] for alloca types 2024-04-11 21:42:35 -04:00
Scott McMurray
593e900ad2 Update 122805 test for PR 123185 2024-04-10 08:28:43 -07:00
Kai Luo
d8d1e6ce21 Limited to little endian target 2024-04-08 11:11:11 +08:00
DianQK
5acfe772fa
Add the test case for #122805 2024-04-07 13:01:54 +08:00
Josh Stone
29430554f6 Update the minimum external LLVM to 17 2024-03-17 10:11:04 -07:00
Erik Desjardins
401651015d test merging of multiple match branches that access fields of the same offset 2024-02-27 23:14:36 -05:00
Erik Desjardins
123015e722 always use gep inbounds i8 (ptradd) for field offsets 2024-02-26 22:28:09 -05:00
bors
5c786a7fe3 Auto merge of #121516 - RalfJung:platform-intrinsics-begone, r=oli-obk
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-26 22:24:16 +00:00
Markus Reiter
b2fbb8a053
Use generic NonZero in tests. 2024-02-25 12:03:48 +01:00