about summary refs log tree commit diff
path: root/src/test/mir-opt/const_prop
AgeCommit message (Collapse)AuthorLines
2019-12-30Lint overflowing integer casts in const propWesley Wiser-0/+49
This extends the invalid cases we catch in const prop to include overflowing integer casts using the same machinery as the overflowing binary and unary operation logic.
2019-12-20Rollup merge of #67130 - wesleywiser:const_prop_into_locals, r=oli-obkMazdak Farrokhzad-4/+153
Const prop should finish propagation into user defined variables Fixes #66638 ~~Temporarily rebased on top of #67015 to get those fixes.~~ r? @oli-obk
2019-12-18Start generating AddressOf rvalues in MIRMatthew Jasper-11/+7
`hir::BorrowKind::Raw` borrows and casting a reference to a raw pointer no longer do a reborrow followed by a cast. Instead we dereference and take the address.
2019-12-13Const prop should finish propagation into user defined variablesWesley Wiser-4/+153
Fixes #66638
2019-12-11Auto merge of #66650 - matthewjasper:nonuniform-array-move, r=pnkfelixbors-6/+0
Remove uniform array move MIR passes This PR fixes a number of bugs caused by limitations of this pass * Projections from constant indexes weren't being canonicalized * Constant indexes from the start weren't being canonicalized (they could have different min_lengths) * It didn't apply to non-moves This PR makes the following changes to support removing this pass: * ConstantIndex of arrays are now generated in a canonical form (from the start, min_length is the actual length). * Subslices are now split when generating move paths and when checking subslices have been moved. Additionally * The parent move path of a projection from an array element is now calculated correctly closes #66502
2019-12-09Remove `uniform_array_move_out` passesMatthew Jasper-6/+0
These passes were buggy, MIR building is now responsible for canonicalizing `ConstantIndex` projections and `MoveData` is responsible for splitting `Subslice` projections.
2019-12-06const-prop: Restrict scalar pair propagationÖmer Sinan Ağacan-0/+72
We now only propagate a scalar pair if the Rvalue is a tuple with two scalars. This for example avoids propagating a (u8, u8) value when Rvalue has type `((), u8, u8)` (see the regression test). While this is a correct thing to do, implementation is tricky and will be done later. Fixes #66971 Fixes #66339 Fixes #67019
2019-11-27Auto merge of #66677 - wesleywiser:fix_const_prop_alloc_id_ice, r=oli-obkbors-7/+7
[const prop] Fix "alloc id without corresponding allocation" ICE r? @oli-obk
2019-11-23[const prop] Fix "alloc id without corresponding allocation" ICEWesley Wiser-7/+7
Fixes #66345
2019-11-21Bless remaining test outputMatthew Jasper-5/+7
2019-11-12Bless mir-dump test.Camille GILLOT-1/+1
2019-11-08[mir-opt] Handle aggregates in SimplifyLocals passWesley Wiser-3/+0
2019-11-08[mir-opt] Handle const-prop for the return placeWesley Wiser-0/+57
2019-10-18[const-prop] Handle MIR Rvalue::BoxWesley Wiser-0/+56
2019-10-18[const-prop] Handle MIR Rvalue::DiscriminantWesley Wiser-0/+53
2019-10-18[const-prop] Handle MIR Rvalue::AggregatesWesley Wiser-0/+25
2019-10-18[const-prop] Handle MIR Rvalue::RepeatWesley Wiser-0/+37
2019-10-09Fix reify_fn_ptr test as we now pretty print const function pointers.ben-1/+1
2019-09-28Allow reading non-mutable statics in const propWesley Wiser-0/+29
2019-09-27[const-prop] Replace `Cast` handling with use of `InterpCx`Wesley Wiser-1/+1
2019-09-27[const-prop] Replace `eval_place()` with use of `InterpCx`Wesley Wiser-1/+1
2019-08-02const_prop no longer does ptr-to-int castsRalf Jung-1/+1
2019-06-13Create fewer basic blocks in match MIR loweringMatthew Jasper-4/+4
2019-06-06[const-prop] Handle Rvalue::LenWesley Wiser-18/+22
2019-06-06[const-prop] Handle ProjectionElem::DerefWesley Wiser-0/+21
2019-06-06[const-prop] Fix ICE when casting function pointersWesley Wiser-0/+25
This fixes an ICE when building libcore with `-Z mir-opt-level=3`.
2019-06-03Add const-eval support for indirectsChristian Poveda-2/+26
2019-05-19[const-prop] Support propagating into SwitchInt's `discr` OperandWesley Wiser-0/+38
2019-05-19[const-prop] Support propagating into Assert's `cond` OperandWesley Wiser-2/+2
2019-05-15Add test to ensure const-prop fails gracefullyWesley Wiser-0/+34
2019-05-15Add some tests for constant propagationWesley Wiser-0/+91
The results aren't ideal but they represent the current state.