Commit Graph

3931 Commits

Author SHA1 Message Date
Gary Guo
9da329d243 Refactor unwind from Option to a new enum 2023-04-06 09:34:16 +01:00
Scott McMurray
dc5a8c8881 Use FieldIdx in various things related to aggregates
Shrank `AggregateKind` by 8 bytes on x64, since the active field of a union is tracked as an `Option<FieldIdx>` instead of `Option<usize>`.
2023-04-01 20:32:50 -07:00
bors
e2e598f5fb Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obk
Insert alignment checks for pointer dereferences when debug assertions are enabled

Closes https://github.com/rust-lang/rust/issues/54915

- [x] Jake tells me this sounds like a place to use `MirPatch`, but I can't figure out how to insert a new basic block with a new terminator in the middle of an existing basic block, using `MirPatch`. (if nobody else backs up this point I'm checking this as "not actually a good idea" because the code looks pretty clean to me after rearranging it a bit)
- [x] Using `CastKind::PointerExposeAddress` is definitely wrong, we don't want to expose. Calling a function to get the pointer address seems quite excessive. ~I'll see if I can add a new `CastKind`.~ `CastKind::Transmute` to the rescue!
- [x] Implement a more helpful panic message like slice bounds checking.

r? `@oli-obk`
2023-03-31 08:50:35 +00:00
Scott McMurray
69b57c2db5 Update ty::VariantDef to use IndexVec<FieldIdx, FieldDef>
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`.

There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places.

Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-30 09:23:40 -07:00
bjorn3
fd4e1d55ea Fix rustc test suite 2023-03-30 12:38:09 +00:00
bjorn3
dc7409c8ec Rustup to rustc 1.70.0-nightly (17c116721 2023-03-29) 2023-03-30 12:22:46 +00:00
bjorn3
86a71bf45b Sync from rust 17c1167216 2023-03-30 12:13:44 +00:00
Matthias Krüger
e88c4052c3 Rollup merge of #109716 - scottmcm:field-to-fieldidx, r=oli-obk
Move `mir::Field` → `abi::FieldIdx`

The first PR for https://github.com/rust-lang/compiler-team/issues/606

This is just the move-and-rename, because it's plenty big already.  Future PRs will start using `FieldIdx` more broadly, and concomitantly removing `FieldIdx::new`s.
2023-03-29 21:19:51 +02:00
John Kåre Alsaker
5a7ce4609e Support TLS access into dylibs on Windows 2023-03-29 08:55:21 +02:00
Scott McMurray
406eb96437 Move mir::Fieldabi::FieldIdx
The first PR for https://github.com/rust-lang/compiler-team/issues/606

This is just the move-and-rename, because it's plenty big-and-bitrotty already.  Future PRs will start using `FieldIdx` more broadly, and concomitantly removing `FieldIdx::new`s.
2023-03-28 22:22:37 -07:00
nils
37ab4bd419 Rollup merge of #108480 - Zoxc:rayon-tlv, r=cuviper
Use Rayon's TLV directly

This accesses Rayon's `TLV` thread local directly avoiding wrapper functions. This makes rustc work with https://github.com/rust-lang/rustc-rayon/pull/10.

r? `@cuviper`
2023-03-28 12:51:12 +02:00
bjorn3
b2796ecb77 Add issue reference to fixmes 2023-03-27 17:52:37 +00:00
bjorn3
edc05ae489 Improve public interface of CValue and CPlace 2023-03-27 17:14:40 +00:00
bjorn3
174b73e3c9 Refactor write_cvalue_maybe_transmute to clarify code flow 2023-03-27 16:50:04 +00:00
bjorn3
a5f11c7aeb Avoid CValue::const_val in a couple of places 2023-03-27 16:30:50 +00:00
bjorn3
0e50c9e4f3 Update example output in pretty_clif.rs 2023-03-27 16:04:50 +00:00
bjorn3
b6cf0a623f Remove CPlace::inner and make CPlaceInner private
This makes it easier to add and remove variants as necessary
2023-03-27 15:44:26 +00:00
bjorn3
e5647908d1 Split codegen_i128::maybe_codegen into two functions 2023-03-27 13:09:10 +00:00
bjorn3
9b40efa24e Fix ICE for --emit llvm-ir 2023-03-27 10:56:15 +00:00
bjorn3
80d93e8a66 Rustup to rustc 1.70.0-nightly (db0cbc48d 2023-03-26) 2023-03-27 10:32:38 +00:00
bjorn3
3b0631a130 Sync from rust db0cbc48d4 2023-03-27 10:26:44 +00:00
bjorn3
d0547f4c99 Run ui/extern tests from the rustc test suite 2023-03-26 17:34:40 +00:00
bjorn3
c0f2b10e15 Skip building crates without tests for regex
regex-capi and regex-debug don't have any tests. Nor do they contain any
code that is useful to test with cg_clif.
2023-03-26 14:07:51 +00:00
bjorn3
5b1268d16b Update portable-simd
This avoids building wasm-bindgen-test on non-wasm targets, reducing
test time.
2023-03-26 13:44:21 +00:00
bjorn3
32f59bad5b Add fixme 2023-03-26 13:40:28 +00:00
bjorn3
257d9005b4 Also include MIR statements in clif ir dumps by default 2023-03-26 11:02:56 +00:00
bjorn3
ae60cb1287
Merge pull request #1366 from bjorn3/rip_out_simd_ssa
Don't store vector types in ssa variables
2023-03-26 12:55:15 +02:00
bjorn3
c3ee030119 Fix passing and returning vector types 2023-03-26 10:22:37 +00:00
Scott McMurray
bb5ac03edb Refactor: VariantIdx::from_u32(0) -> FIRST_VARIANT
Since structs are always `VariantIdx(0)`, there's a bunch of files where the only reason they had `VariantIdx` or `vec::Idx` imported at all was to get the first variant.

So this uses a constant for that, and adds some doc-comments to `VariantIdx` while I'm there, since it doesn't have any today.
2023-03-25 18:58:25 -07:00
bjorn3
a28adc881c
Merge pull request #1365 from bjorn3/dev-release
Publish latest build as release
2023-03-25 18:03:18 +01:00
bjorn3
aab1526164 Recreate the release every time
To ensure people who watch the repo for release notifications actually get a
notification.
2023-03-25 16:24:15 +00:00
bjorn3
eed1f75415 Don't store vector types in ssa variables
They have been causing a lot of trouble. For example current MIR
building thinks that it is fine to dynamically index into them. And
there are different paths depending on if the repr(simd) struct uses
fields or a single array as interior. There is also trouble with moving
the inner array of a repr(simd) type that is an array wrapper.

If performance becomes a concern, I will implement this in a more
principled way.
2023-03-25 14:30:12 +00:00
John Kåre Alsaker
92bb0a85e9 Update indexmap and rayon crates 2023-03-25 02:12:13 +01:00
bjorn3
cc570ae05c Publish a dev release on every commit 2023-03-24 19:23:04 +00:00
bjorn3
ccab9b0e84 Remove stale assets 2023-03-24 19:22:45 +00:00
bjorn3
273ca2f537 Update action name 2023-03-24 19:22:35 +00:00
bjorn3
608ca6f45b Add license identifiers 2023-03-24 19:22:35 +00:00
bjorn3
6352a405dd Import github-release from bytecodealliance/wasmtime@a002a2cc5e 2023-03-24 19:22:28 +00:00
bjorn3
6bced6e434 Ignore Inlined spans when computing caller location
cc rust-lang/rust#109307
2023-03-24 09:24:17 +00:00
bjorn3
5c9f0073ee Rustup to rustc 1.70.0-nightly (1459b3128 2023-03-23) 2023-03-24 08:38:14 +00:00
bjorn3
d170b6bf80 Sync from rust 1459b3128e 2023-03-24 08:32:31 +00:00
Ben Kimock
8b18860677 A MIR transform that checks pointers are aligned 2023-03-23 18:23:06 -04:00
bors
7ac6cc905e Auto merge of #108442 - scottmcm:mir-transmute, r=oli-obk
Add `CastKind::Transmute` to MIR

~~Nothing actually produces it in this commit, so I don't know how to test it, but it also means it shouldn't be possible for it to break anything.~~

Includes lowering `transmute` calls to it, so it's used.

Zulip Conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Good.20first.20isssue/near/321849610>
2023-03-23 18:43:04 +00:00
Scott McMurray
9558e12965 Add CastKind::Transmute to MIR
Updates `interpret`, `codegen_ssa`, and `codegen_cranelift` to consume the new cast instead of the intrinsic.

Includes `CastTransmute` for custom MIR building, to be able to test the extra UB.
2023-03-22 15:15:41 -07:00
bjorn3
ae0a22cb89 Update regex to fix FreeBSD tests
Fixes #1360
2023-03-21 14:52:03 +00:00
bjorn3
76a1cfb0e6 Give an error if any of the wrappers can't find cargo, rustc or rustdoc
Fixes #1364
2023-03-21 13:41:28 +00:00
bjorn3
74e865904c
Merge pull request #1363 from bjorn3/update_cranelift
Update to Cranelift 0.94
2023-03-21 14:36:26 +01:00
bjorn3
b15fd79f43 Update to Cranelift 0.94 2023-03-21 10:23:42 +00:00
Mu42
60aafee963 Remove Ty::is_region_ptr 2023-03-20 15:32:21 +08:00
bjorn3
a040947a9e Remove no longer necessary eliminate_unreachable_code pass
cranelift-frontend now uses iconst.i64 + uextend instead of the invalid
iconst.i128.
2023-03-18 15:29:46 +00:00