Oliver Scherer
888afd50d9
Unify the names of const eval queries and their return types
2020-09-19 10:36:36 +02:00
Oliver Scherer
69a6be73e6
Rename const eval queries to reflect the validation changes
2020-09-19 10:36:36 +02:00
Oliver Scherer
dd9702a059
Do not call the const_eval
query in mir interpretation except for caching of nulary intrinsics
2020-09-19 10:36:36 +02:00
Oliver Scherer
48f366fced
Replace and_then
map_err
and_then
chain with a match
2020-09-19 10:36:36 +02:00
Oliver Scherer
b1bd34df0c
turn_into_const
is infallible
2020-09-19 10:36:36 +02:00
Oliver Scherer
4397d66d42
Document op_to_const
's purpose
2020-09-19 10:36:36 +02:00
Oliver Scherer
2d7ac728e4
Stop using the const_eval
query for initializers of statics
...
As a side effect, we now represent most promoteds as `ConstValue::Scalar` again. This is useful because all implict promoteds are just references anyway and most explicit promoteds are numeric arguments to `asm!` or SIMD instructions.
2020-09-19 10:36:36 +02:00
Oliver Scherer
083f1d7a37
Validate constants during const_eval_raw
2020-09-19 10:36:36 +02:00
Mara Bos
1e2dba1e7c
Use T::BITS
instead of size_of::<T> * 8
.
2020-09-19 06:54:42 +02:00
bors
a2c82df1f5
Auto merge of #76838 - est31:dogfood_uninit_features, r=oli-obk
...
Dogfood new_uninit and maybe_uninit_slice in rustc_arena
Dogfoods a few cool `MaybeUninit` related features in the compiler's rustc_arena crate.
Split off from #76821
r? `@oli-obk`
2020-09-19 02:21:19 +00:00
Jonas Schievink
2f9271b14c
Clarify FIXME
2020-09-18 21:23:01 +02:00
Jonas Schievink
ffd9445812
Return Place
by value
2020-09-18 21:23:01 +02:00
Jonas Schievink
682de94e31
Move inner items outside
2020-09-18 21:23:01 +02:00
Jonas Schievink
cd5d7201ad
Fix rebase fallout
2020-09-18 21:23:01 +02:00
Jonas Schievink
7af964fecf
Limit block count
2020-09-18 21:23:01 +02:00
Jonas Schievink
5728834448
Fix rebase fallout
2020-09-18 21:23:01 +02:00
Jonas Schievink
484db5b08a
Properly inherit conflicts when merging locals
2020-09-18 21:23:01 +02:00
Jonas Schievink
934634eacc
More logging
2020-09-18 21:23:01 +02:00
Jonas Schievink
88538adf9a
Record intra-statement/terminator conflicts
...
Some MIR statements and terminators have an (undocumented...) invariant
that some of their input and outputs must not overlap. This records
conflicts between locals used in these positions.
2020-09-18 21:23:01 +02:00
Jonas Schievink
ddd6930b54
perf: bail out when there's >500 candidate locals
2020-09-18 21:23:01 +02:00
Jonas Schievink
ab26fb140c
perf: only calculate conflicts for candidates
2020-09-18 21:23:01 +02:00
Jonas Schievink
402f863d8a
perf: walk liveness backwards in Conflicts::build
2020-09-18 21:23:00 +02:00
Jonas Schievink
812d4bbc8d
Fix dataflow assert errors
2020-09-18 21:23:00 +02:00
Jonas Schievink
78ff69ba10
Implement a destination propagation pass
2020-09-18 21:23:00 +02:00
Bastian Kauschke
925cd26162
don't take TyCtxt
by reference
2020-09-18 20:49:25 +02:00
Matthias Krüger
40dddd3305
use matches!() macro for simple if let conditions
2020-09-18 20:28:35 +02:00
bors
9f8ac718f4
Auto merge of #76575 - lcnr:abstract-const, r=oli-obk
...
compare generic constants using `AbstractConst`s
This is a MVP of rust-lang/compiler-team#340. The changes in this PR should only be relevant if `feature(const_evaluatable_checked)` is enabled.
~~currently based on top of #76559 , so blocked on that.~~
r? `@oli-obk` cc `@varkor` `@eddyb`
2020-09-18 16:59:50 +00:00
Aaron Hill
6a96aea36a
Wrap recursive predicate evaluation with ensure_sufficient_stack
...
I haven't been able to come up with a minimized test case for #76770 ,
but this fixes a stack overflow in rustc as well.
2020-09-18 12:24:42 -04:00
Bastian Kauschke
b7641209d7
add const-evaluatable_checked
check back in
2020-09-18 17:36:11 +02:00
Bastian Kauschke
09e6254496
review, small cleanup
2020-09-18 17:11:34 +02:00
Bastian Kauschke
1b275d08ad
document const_evaluatable
2020-09-18 17:11:34 +02:00
Bastian Kauschke
7fff155d2a
remove allow(warnings)
2020-09-18 17:11:34 +02:00
Bastian Kauschke
30ff1ef3d0
support const_evaluatable_checked across crate boundaries
2020-09-18 17:11:34 +02:00
Bastian Kauschke
82ebbd7d6b
add test for let-bindings
2020-09-18 17:11:34 +02:00
Bastian Kauschke
c7d16df1d8
add function calls
2020-09-18 17:11:34 +02:00
Bastian Kauschke
d1294e0ce2
allow unary operations and ignore StorageLive/Dead stmts
2020-09-18 17:11:34 +02:00
Bastian Kauschke
5a277822a5
use newtype_index for abstract_const::NodeId
2020-09-18 17:11:34 +02:00
Bastian Kauschke
f24d532749
refactor AbstractConstBuilder
2020-09-18 17:11:34 +02:00
Bastian Kauschke
c3a772f55f
use abstract consts when unifying ConstKind::Unevaluated
2020-09-18 17:11:34 +02:00
Bastian Kauschke
d327fa112b
initial working state
2020-09-18 16:25:25 +02:00
bors
fdc3405c20
Auto merge of #72412 - VFLashM:issue-72408-nested-closures-exponential, r=tmandry
...
Issue 72408 nested closures exponential
This fixes #72408 .
Nested closures were resulting in exponential compilation time.
This PR is enhancing asymptotic complexity, but also increasing the constant, so I would love to see perf run results.
2020-09-18 14:08:39 +00:00
Jake Goulding
9803c9b252
Update cc crate to understand aarch64-apple-darwin with clang
2020-09-18 09:22:07 -04:00
bors
2c69266c06
Auto merge of #76837 - wesleywiser:disable_consideredequal, r=oli-obk
...
[mir-opt] Disable the `ConsideredEqual` logic in SimplifyBranchSame opt
The logic is currently broken and we need to disable it to fix a beta
regression (see #76803 )
r? `@oli-obk`
2020-09-18 10:54:14 +00:00
Tyler Mandry
3ccb1c37e6
Remove redundancy in cache key
2020-09-18 09:03:53 +00:00
Juan Aguilar Santillana
28cfa9730e
Simplify panic_if_treat_err_as_bug avoiding allocations
2020-09-18 05:57:01 +00:00
est31
2805a05154
Add bench_typed_arena_clear_100 bench
2020-09-18 05:52:45 +02:00
est31
daccd1709e
Replace loop with drop_in_place call
2020-09-18 04:49:02 +02:00
est31
5acfcceb47
Dogfood new_uninit and maybe_uninit_slice in rustc_arena
2020-09-18 04:49:02 +02:00
Valerii Lashmanov
f583513dc2
Intorduced MiniMap - a tiny small storage optimized map implementation
...
This makes everything about 1% faster in rustc-perf,
mostly negating performance hit of previous commit.
2020-09-17 20:44:11 -05:00
Valerii Lashmanov
17d2e3b5d2
Better handling for exponential-sized types in misc places
...
Mostly to fix ui/issues/issue-37311-type-length-limit/issue-37311.rs.
Most parts of the compiler can handle deeply nested types with a lot
of duplicates just fine, but some parts still attempt to naively
traverse type tree.
Before such problems were caught by type length limit check,
but now these places will have to be changed to handle
duplicated types gracefully.
2020-09-17 20:44:11 -05:00