Ralf Jung
48f2f0d725
preserve span when evaluating mir::ConstOperand
2024-03-14 21:55:07 +01:00
Oli Scherer
d3514a036d
Ensure nested allocations in statics do not get deduplicated
2024-03-12 05:53:46 +00:00
bors
52f8aec14c
Auto merge of #121985 - RalfJung:interpret-return-place, r=oli-obk
...
interpret: avoid a long-lived PlaceTy in stack frames
`PlaceTy` uses a representation that's not very stable under changes to the stack. I'd feel better if we didn't have one in the long-term machine state.
r? `@oli-obk`
2024-03-07 12:33:19 +00:00
Nicholas Nethercote
18715c98c6
Rename DiagnosticMessage
as DiagMessage
.
2024-03-05 12:14:49 +11:00
Ralf Jung
3f0b6a0d1c
consistently use MPlaceTy for return places
2024-03-04 23:40:26 +01:00
Nicholas Nethercote
8199632aa8
Rename DiagnosticArg{,Map,Name,Value}
as DiagArg{,Map,Name,Value}
.
2024-02-28 08:55:37 +11:00
Gurinder Singh
50e316bdc0
Remove const_prop.rs
...
and move its content to const_prop_lint.rs and dataflow_const_prop.rs where it is used
2024-02-18 15:31:44 +05:30
Camille GILLOT
7a6b00e786
Remove untested arithmetic ops.
2024-02-09 21:06:25 +00:00
Camille GILLOT
28df0a62f6
Compute binary ops between pointers in GVN.
2024-02-09 21:01:57 +00:00
Michael Goulet
c567eddec2
Add CoroutineClosure to TyKind, AggregateKind, UpvarArgs
2024-02-06 02:22:58 +00:00
Ralf Jung
64cd13ff3b
add test for GVN issue; cleanup in dataflow_const_prop
2024-01-26 10:40:29 +01:00
Oli Scherer
1f398abcb6
const prop nonsense eliminated
2024-01-23 16:34:43 +00:00
Matthias Krüger
8479945c08
NFC don't convert types to identical types
2023-12-15 23:56:24 +01:00
surechen
40ae34194c
remove redundant imports
...
detects redundant imports that can be eliminated.
for #117772 :
In order to facilitate review and modification, split the checking code and
removing redundant imports code into two PR.
2023-12-10 10:56:22 +08:00
Ralf Jung
4d93590d59
compile-time evaluation: emit a lint when a write through an immutable pointer occurs
2023-12-07 17:46:36 +01:00
Nilstrieb
21a870515b
Fix clippy::needless_borrow
in the compiler
...
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.
Then I had to remove a few unnecessary parens and muts that were exposed
now.
2023-11-21 20:13:40 +01:00
Mark Rousskov
917f6540ed
Re-format code with new rustfmt
2023-11-15 21:45:48 -05:00
George Bateman
9d6ce61376
Update MIR tests for offset_of
2023-10-31 23:26:02 +00:00
George Bateman
e936416a8d
Support enum variants in offset_of!
2023-10-31 23:25:54 +00:00
Camille GILLOT
38c86b0798
Evaluate computed values to constants.
2023-10-25 06:46:47 +00:00
Camille GILLOT
8c1b039d48
Use a ConstValue instead.
2023-10-21 16:26:05 +00:00
Camille GILLOT
31d101093c
Generate ValTrees in DataflowConstProp.
2023-10-21 16:20:46 +00:00
Ralf Jung
a993a8bf3f
const-eval: make misalignment a hard error
2023-09-26 15:32:55 +02:00
bors
0fd7ce99b0
Auto merge of #116010 - RalfJung:more-typed-immediates, r=oli-obk
...
interpret: more consistently use ImmTy in operators and casts
The diff in src/tools/miri/src/shims/x86/sse2.rs should hopefully suffice to explain why this is nicer. :)
2023-09-21 14:02:55 +00:00
Ralf Jung
c94410c145
rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const
2023-09-21 08:12:30 +02:00
Ralf Jung
0eff07b748
try to avoid some layout_of calls
2023-09-21 07:26:16 +02:00
Ralf Jung
da08a3f40c
interpret: more consistently use ImmTy in operators and casts
2023-09-20 21:57:54 +02:00
Ralf Jung
5a0a1ff0cd
move ConstValue into mir
...
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-19 11:11:02 +02:00
bors
5adddad28c
Auto merge of #115797 - cjgillot:const-prop-noclone, r=oli-obk
...
Do not clone the Body for ConstProp
~Based on https://github.com/rust-lang/rust/pull/115748 for the `POST_MONO_CHECKS` flag.~
2023-09-13 16:30:07 +00:00
Ralf Jung
6e4779ab17
make the eval() functions on our const types return the resulting value
2023-09-13 07:29:34 +02:00
Camille GILLOT
32fe00ae85
Reuse CollectAndPatch for normal ConstProp.
2023-09-12 20:17:55 +00:00
Camille GILLOT
8a3a0dd64e
Store a ConstantKind in CollectAndPatch.
2023-09-12 20:17:55 +00:00
Camille GILLOT
bcfe1a4bf2
Remove cur_span hook.
2023-09-11 16:29:42 +00:00
Camille GILLOT
24adf07e5f
Reuse throw_machine_stop_str! macro.
2023-09-11 16:29:41 +00:00
Camille GILLOT
d278ce126c
Return ImmTy in discriminant_for_variant.
2023-09-11 16:29:41 +00:00
Camille GILLOT
1d6a32c920
Interpret Immediate::Uninit as Bottom.
2023-09-11 16:29:41 +00:00
Camille GILLOT
b851e554dd
Support CopyForDeref.
2023-09-11 16:29:41 +00:00
Camille GILLOT
82f0468009
Handle reading statics.
2023-09-11 16:29:41 +00:00
Camille GILLOT
6ad6b4381c
Support non-scalar constants.
2023-09-11 16:29:41 +00:00
Camille GILLOT
f96c6e04cb
Propagate PlaceElem::Index.
2023-09-06 16:09:31 +00:00
Camille GILLOT
fc63543792
Support array length.
2023-09-06 16:05:04 +00:00
Camille GILLOT
22986b72e5
Implement algebraic simplifications.
2023-09-06 15:57:50 +00:00
Camille GILLOT
74a967bcec
Support a few more rvalues.
2023-09-06 15:52:06 +00:00
Camille GILLOT
7ef555d84a
Support non-trivial scalars in ConstProp.
2023-09-05 21:25:41 +00:00
Camille GILLOT
09ce0f6ebc
Remove type from ScalarTy.
2023-09-05 21:25:41 +00:00
Jason Newcomb
f686bd8949
Take &mut Results
in ResultsVisitor
2023-09-02 19:35:51 -04:00
Ralf Jung
ac3bca24b7
interpret: have assert_* intrinsics call the panic machinery instead of a direct abort
2023-08-20 15:52:40 +02:00
Camille GILLOT
b8fed2f21c
Make dataflow const-prop handle_switch_int monotonic.
2023-08-16 18:12:18 +00:00
Camille GILLOT
388f6a6413
Make TerminatorEdge plural.
2023-08-16 18:12:18 +00:00
Camille GILLOT
f19cd3f2e1
Use TerminatorEdge for dataflow-const-prop.
2023-08-16 18:12:18 +00:00