Commit Graph

1486 Commits

Author SHA1 Message Date
Ulrich Weigand
aca05cf603 Fix alignment flag for emit_small_memory_copy
Do not unconditionally pass the "aligned" MemFlag when calling
emit_small_memory_copy.  Instead, allow the back end to rely on
the alignment info passed separately to this routine.
2022-08-12 12:54:41 +02:00
bjorn3
fa6480e43d Remove most trap functions and remove all trapnz usages 2022-08-09 12:27:34 +00:00
bjorn3
7368f5601e Sync from rust f03ce30962 2022-08-08 17:01:38 +02:00
Afonso Bordado
8c8fc6af33 Use native cranelift instructions when lowering float intrinsics 2022-08-03 13:36:50 +01:00
Afonso Bordado
49e773183e
Update to cranelift 0.86 (#1250) 2022-07-28 21:08:05 +02:00
bjorn3
451817e48f Introduce an ArchiveBuilderBuilder
This avoids monomorphizing all linker code for each codegen backend and
will allow passing in extra information to the archive builder from the
codegen backend.
2022-07-28 09:08:47 +00:00
bjorn3
34b37e76dd Inline inject_dll_import_lib 2022-07-28 08:43:15 +00:00
bjorn3
e0697a309d Move output argument from ArchiveBuilder::new to .build() 2022-07-28 08:39:19 +00:00
bjorn3
72c69a829f Merge branch 'sync_from_rust' 2022-07-26 18:54:54 +02:00
bjorn3
a6260ecd81 Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26 2022-07-26 18:53:46 +02:00
bjorn3
d3a2366ee8 Implement some more llvm float compare intrinsic options 2022-07-26 16:27:14 +00:00
bjorn3
d3099a40c7 Outline a bug! invocation
This reduces the amount of llvm ir lines for intrinsic related code from
23801 to 20478.
2022-07-26 16:26:35 +00:00
bjorn3
54eb0d992a Fully remove the intrinsic_match macro 2022-07-26 16:09:41 +00:00
bjorn3
e151964a70 Start moving away from the intrinsic_match macro
It isn't clear most people other than me and it blocks formatting by
rustfmt.
2022-07-26 15:17:34 +00:00
bors
1fb02e0409 Auto merge of #99745 - JohnTitor:rollup-lvrie64, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #98211 (Implement `fs::get_path` for FreeBSD.)
 - #99353 (Slightly improve mismatched GAT where clause error)
 - #99593 (Suggest removing the tuple struct field for the unwrapped value)
 - #99615 (Remove some explicit `self.infcx` for `FnCtxt`, which already derefs into `InferCtxt`)
 - #99711 (Remove reachable coverage without counters)
 - #99718 (Avoid `&str`/`Symbol` to `String` conversions)
 - #99720 (Sync rustc_codegen_cranelift)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-26 04:28:41 +00:00
bors
42dd106b67 Auto merge of #98989 - dpaoliello:rawdylibbin, r=michaelwoerister
Enable raw-dylib for bin crates

Fixes #93842

When `raw-dylib` is used in a `bin` crate, we need to collect all of the `raw-dylib` functions, generate the import library and add that to the linker command line.

I also changed the tests so that 1) the C++ dlls are created after the Rust dlls, thus there is no chance of accidentally using them in the Rust linking process and 2) disabled generating import libraries when building with MSVC.
2022-07-26 01:47:34 +00:00
bjorn3
640c3f730a Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25 2022-07-25 16:07:57 +02:00
bjorn3
4e1155fbf1 Sync from rust 2f320a224e 2022-07-25 16:00:44 +02:00
bjorn3
fd2669d1e9 Fix -Zpolymorphize 2022-07-25 13:17:53 +00:00
bjorn3
7ef2ba8f7b Fix size_of_val and min_align_of_val for truly unsized types 2022-07-25 12:47:49 +00:00
bjorn3
39ee14d253 Error when trying to define variadic functions
They aren't yet supported by Cranelift
2022-07-25 11:18:34 +00:00
bjorn3
3207c9faec Report an error on incompatible symbol definitions 2022-07-22 19:03:06 +00:00
bjorn3
a6b602dc32 Fix inline asm codegen for empty template 2022-07-22 18:59:16 +00:00
bjorn3
cd96988436 Don't crash when local variables are too big to store on the stack 2022-07-22 18:03:24 +00:00
Daniel Paoliello
0fed1a5f57 Enable raw-dylib for binaries 2022-07-22 09:55:14 -07:00
Ralf Jung
d07ed02783 various nits from review 2022-07-20 17:12:08 -04:00
bjorn3
f8feed7d27 Implement vtable_size and vtable_align intrinsics for cg_clif 2022-07-20 17:12:07 -04:00
Ralf Jung
6c9abfa0f3 slightly cleaner, if more verbose, vtable handling in codegen backends 2022-07-20 17:12:07 -04:00
Ralf Jung
a1b172224c consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable) 2022-07-20 17:12:07 -04:00
Ralf Jung
b5cce74278 rename get_global_alloc to try_get_global_alloc 2022-07-20 17:09:22 -04:00
Ralf Jung
1c77e2b922 add a Vtable kind of symbolic allocations 2022-07-20 16:57:31 -04:00
Oli Scherer
22a0a2eac2 Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"
This reverts commit 6f8fb911ad, reversing
changes made to 7210e46dc6.
2022-07-20 07:55:58 +00:00
bjorn3
cff5eed8ef Sync from rust 880416180b 2022-07-18 12:10:52 +02:00
bors
33b297a525 Auto merge of #99033 - 5225225:interpreter-validity-checks, r=oli-obk
Use constant eval to do strict mem::uninit/zeroed validity checks

I'm not sure about the code organisation here, I just dumped the check in rustc_const_eval at the root. Not hard to move it elsewhere, in any case.

Also, this means cranelift codegen intrinsics lose the strict checks, since they don't seem to depend on rustc_const_eval, and I didn't see a point in keeping around two copies.

I also left comments in the is_zero_valid methods about "uhhh help how do i do this", those apply to both methods equally.

Also rustc_codegen_ssa now depends on rustc_const_eval... is this okay?

Pinging `@RalfJung` since you were the one who mentioned this to me, so I'm assuming you're interested.

Haven't had a chance to run full tests on this since it's really warm, and it's 1AM, I'll check out any failures/comments in the morning :)
2022-07-17 19:28:01 +00:00
Oli Scherer
9ea9c093e5 Introduce opaque type to hidden type projection 2022-07-15 15:49:22 +00:00
5225225
5a81bf7ad2 Use constant eval to do strict validity checks 2022-07-14 22:55:17 +01:00
Joshua Nelson
b2ae24e6a1 Rename debugging_opts to unstable_opts
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.
2022-07-13 17:47:06 -05:00
bors
43388812a6 Auto merge of #99210 - Dylan-DPC:rollup-879cp1t, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #98574 (Lower let-else in MIR)
 - #99011 (`UnsafeCell` blocks niches inside its nested type from being available outside)
 - #99030 (diagnostics: error messages when struct literals fail to parse)
 - #99155 (Keep unstable target features for asm feature checking)
 - #99199 (Refactor: remove an unnecessary `span_to_snippet`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-13 17:13:27 +00:00
Dylan DPC
38c321a6f0 Rollup merge of #99155 - Amanieu:unstable-target-features, r=davidtwco
Keep unstable target features for asm feature checking

Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.

Fixes #99071
2022-07-13 19:32:36 +05:30
ouz-a
9efccc97e2 add new rval, pull deref early 2022-07-12 14:26:41 +03:00
Amanieu d'Antras
a7347a941b Keep unstable target features for asm feature checking
Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.

Fixes #99071
2022-07-11 14:26:58 +01:00
Ralf Jung
c78b43878f tweak names and output and bless 2022-07-09 07:43:56 -04:00
Ralf Jung
f44d5feb5b review feedback 2022-07-09 07:27:29 -04:00
Ralf Jung
e9442b60e0 fix cranelift and gcc backends 2022-07-09 07:27:29 -04:00
David Wood
69d0c1e9ac incr: cache dwarf objects in work products
Cache DWARF objects alongside object files in work products when those
exist so that DWARF object files are available for thorin in packed mode
in incremental scenarios.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06 11:15:13 +01:00
Alan Egerton
44c2558504 Update TypeVisitor paths 2022-07-06 06:41:53 +01:00
bors
96bdb398f9 Auto merge of #96862 - oli-obk:enum_cast_mir, r=RalfJung
Change enum->int casts to not go through MIR casts.

follow-up to https://github.com/rust-lang/rust/pull/96814

this simplifies all backends and even gives LLVM more information about the return value of `Rvalue::Discriminant`, enabling optimizations in more cases.
2022-07-05 09:36:29 +00:00
bjorn3
b344691522 Sync from rust f99f9e48ed 2022-07-03 14:51:45 +02:00
bjorn3
14b2f8f98d Add code to print clif ir on panics during define_function 2022-07-02 19:38:50 +02:00
Camille GILLOT
a71e691e74 Recover when failing to normalize closure signature. 2022-06-30 21:45:29 +02:00