Commit Graph

3753 Commits

Author SHA1 Message Date
bjorn3
9a0c174dfd Add weekly cargo-audit CI run 2023-07-24 12:20:14 +00:00
bjorn3
3f533f4631 Merge branch 'sync_from_rust' 2023-07-22 13:36:29 +00:00
bjorn3
e8168ce8a3 Merge commit '1eded3619d0e55d57521a259bf27a03906fdfad0' into sync_cg_clif-2023-07-22 2023-07-22 13:32:34 +00:00
bjorn3
1eded3619d Update to Cranelift 0.98 2023-07-22 11:32:25 +00:00
bjorn3
ebe2825966 Fix rustc test suite 2023-07-22 11:27:49 +00:00
bjorn3
4eabaf331f Rustup to rustc 1.73.0-nightly (0308df23e 2023-07-21) 2023-07-22 11:11:45 +00:00
bjorn3
a8a722f211 Sync from rust 0308df23e6 2023-07-22 10:54:06 +00:00
chenx97
648f5e4208 support for mips64r6 as a target_arch value 2023-07-18 18:58:18 +08:00
Nicholas Nethercote
46f74fb4d2 Introduce MonoItemData.
It replaces `(Linkage, Visibility)`, making the code nicer. Plus the
next commit will add another field.
2023-07-17 08:44:48 +10:00
bjorn3
84afcee743 Improve benchmarking step summary format 2023-07-16 12:54:48 +00:00
bjorn3
448b7a3a12 Record GHA step summaries for benchmarking 2023-07-16 12:33:39 +00:00
bors
4f16abdff6 Auto merge of #112157 - erikdesjardins:align, r=nikic
Resurrect: rustc_target: Add alignment to indirectly-passed by-value types, correcting the alignment of byval on x86 in the process.

Same as #111551, which I [accidentally closed](https://github.com/rust-lang/rust/pull/111551#issuecomment-1571222612) :/

---

This resurrects PR #103830, which has sat idle for a while.

Beyond #103830, this also:
- fixes byval alignment for types containing vectors on Darwin (see `tests/codegen/align-byval-vector.rs`)
- fixes byval alignment for overaligned types on x86 Windows (see `tests/codegen/align-byval.rs`)
- fixes ABI for types with 128bit requested alignment on ARM64 Linux (see `tests/codegen/aarch64-struct-align-128.rs`)

r? `@nikic`

---

`@pcwalton's` original PR description is reproduced below:

Commit 88e4d2c from five years ago removed
support for alignment on indirectly-passed arguments because of problems with
the `i686-pc-windows-msvc` target. Unfortunately, the `memcpy` optimizations I
recently added to LLVM 16 depend on this to forward `memcpy`s. This commit
attempts to fix the problems with `byval` parameters on that target and now
correctly adds the `align` attribute.

The problem is summarized in [this comment] by `@eddyb.` Briefly, 32-bit x86 has
special alignment rules for `byval` parameters: for the most part, their
alignment is forced to 4. This is not well-documented anywhere but in the Clang
source. I looked at the logic in Clang `TargetInfo.cpp` and tried to replicate
it here. The relevant methods in that file are
`X86_32ABIInfo::getIndirectResult()` and
`X86_32ABIInfo::getTypeStackAlignInBytes()`. The `align` parameter attribute
for `byval` parameters in LLVM must match the platform ABI, or miscompilations
will occur. Note that this doesn't use the approach suggested by eddyb, because
I felt it was overkill to store the alignment in `on_stack` when special
handling is really only needed for 32-bit x86.

As a side effect, this should fix #80127, because it will make the `align`
parameter attribute for `byval` parameters match the platform ABI on LLVM
x86-64.

[this comment]: #80822 (comment)
2023-07-15 15:39:53 +00:00
Mahdi Dibaiee
d45c8c3e7c refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
bjorn3
fae8935e3d Avoid installing rustc-dev in the rustfmt CI job 2023-07-13 11:39:04 +00:00
bjorn3
aa6916bd01 Use correct lang item for AssertKind::MisalignedPointerDereference
cc #1381
2023-07-12 19:03:27 +00:00
bjorn3
c3a0431731 Avoid recursive cargo calls when doing cargo clif instead of cargo-clif
Fixes #1383
2023-07-12 17:24:46 +00:00
bjorn3
c137418bde Explicitly disable git gpg signing
Otherwise building fails if the user has globally enabled gpg signing.

Fixes #1384
2023-07-12 17:21:14 +00:00
bjorn3
34d63e4c1d Use GHA log grouping 2023-07-12 16:45:42 +00:00
bjorn3
8b9187dfec Fix rustc test suite 2023-07-12 14:47:23 +00:00
bjorn3
c28878d8f2 Rustup to rustc 1.73.0-nightly (993deaa0b 2023-07-11) 2023-07-12 14:31:00 +00:00
bjorn3
2922d41fa5 Sync from rust 993deaa0bf 2023-07-12 13:42:45 +00:00
Erik Desjardins
388a6b5835 cg_clif: just ignore all the unused LayoutS fields 2023-07-10 19:19:41 -04:00
Erik Desjardins
6f16da3ee7 repr(align) <= 4 should still be byval 2023-07-10 19:19:40 -04:00
Erik Desjardins
d2d76ef358 cg_clif: add has_repr_align 2023-07-10 19:19:40 -04:00
Nilstrieb
1cae70145c Rename adjustment::PointerCast and variants using it to PointerCoercion
It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related
casts, when in reality their just used to share a some enum variants. Make it clear there these
are only coercion to make it clear why only some pointer related "casts" are in the enum.
2023-07-07 18:17:16 +02:00
Boxy
40de0c2765 Move TyCtxt::mk_x to Ty::new_x where applicable 2023-07-05 20:27:07 +01:00
Boxy
b5b1c0eddc Deal with fallout 2023-07-05 09:46:30 +01:00
bors
b51f778846 Auto merge of #113116 - nnethercote:codegen-opts, r=oli-obk
A mish-mash of micro-optimizations

These were aimed at speeding up LLVM codegen, but ended up affecting other places as well.

r? `@bjorn3`
2023-06-30 00:35:19 +00:00
Nicholas Nethercote
9db001dfbb Avoid unnecessary line lookup.
`lookup_debug_loc` calls `SourceMap::lookup_line`, which does a binary
search over the files, and then a binary search over the lines within
the found file. It then calls `SourceFile::line_begin_pos`, which redoes
the binary search over the lines within the found file.

This commit removes the second binary search over the lines, instead
getting the line starting pos directly using the result of the first
binary search over the lines.

(And likewise for `get_span_loc`, in the cranelift backend.)
2023-06-29 11:26:39 +10:00
bjorn3
d3e9e424a1 Update setup_rust_fork.sh for cg_clif build layout changes 2023-06-28 16:52:02 +00:00
bjorn3
ab12203187 Rustup to rustc 1.72.0-nightly (5ea666864 2023-06-27) 2023-06-28 16:45:15 +00:00
许杰友 Jieyou Xu (Joe)
2cdf8a4c3f Provide more context for rustc +nightly -Zunstable-options on stable 2023-06-27 23:23:33 +08:00
bjorn3
85b5253806
Merge pull request #1382 from cuviper/indexmap-2
Upgrade to indexmap v2
2023-06-25 14:13:43 +02:00
Josh Stone
814f46c39d Minor cleanup around IndexSet 2023-06-24 17:43:35 -07:00
Josh Stone
ff10c0f037 Upgrade to indexmap v2 2023-06-24 17:42:48 -07:00
bjorn3
e44f47adf7
Merge pull request #1380 from bjorn3/more_vendor_intrinsics
Implement a whole bunch more x86 vendor intrinsics
2023-06-23 14:17:35 +02:00
bjorn3
aee30c5ddc Implement _mm_abs_epi* 2023-06-23 10:37:57 +00:00
bjorn3
92a4093850 Implement _mm_storeu_pd 2023-06-23 10:31:52 +00:00
bjorn3
d957015234 Implement _mm_slli_epi64 2023-06-23 10:28:27 +00:00
bjorn3
cb0a9b9550 Implement _addcarryx_{u32,u64} 2023-06-23 10:23:20 +00:00
bjorn3
8cad29a529 Implement _xgetbv 2023-06-23 10:05:18 +00:00
bjorn3
aef31cb2f3 Implement _mm_srli_epi64 2023-06-23 09:35:39 +00:00
bjorn3
bbf45081b7 Implement _mm_srai_epi* and _mm256_srai_epi* 2023-06-23 09:32:52 +00:00
bjorn3
71cb045c7d Fix _mm_cmp*_ps 2023-06-23 09:27:15 +00:00
bjorn3
7cbc8bcb4b Implement nontemporal_store using a regular store 2023-06-23 09:19:11 +00:00
bjorn3
41af17a9d1 Implement more _mm_cmp*_{ps,pd} intrinsics 2023-06-23 09:18:56 +00:00
bjorn3
0311202fd4 Implement _addcarry_u32 and _subborrow_u32 2023-06-23 09:17:02 +00:00
bjorn3
6b141f39d2 Rustup to rustc 1.72.0-nightly (065a1f5df 2023-06-21) 2023-06-22 18:45:21 +00:00
bjorn3
ee1793432d Sync from rust 065a1f5df9 2023-06-22 18:40:02 +00:00
bjorn3
c8620a3cbf Nicer error when implementation limits are exceeded
Fixes #1370
2023-06-20 15:48:00 +00:00