about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/const_prop.rs
AgeCommit message (Collapse)AuthorLines
2021-09-07Move rustc_mir::transform to rustc_mir_transform.Camille GILLOT-1312/+0
2021-09-02ty::layout: split `LayoutOf` into required and (blanket) provided halves.Eduard-Mihai Burtescu-2/+2
2021-09-02ty::layout: implement `layout_of` automatically as a default method.Eduard-Mihai Burtescu-2/+3
2021-09-02rustc_target: move `LayoutOf` to `ty::layout`.Eduard-Mihai Burtescu-5/+4
2021-08-27rustc_target: require `TyAbiInterface` in `LayoutOf`.Eduard-Mihai Burtescu-2/+9
2021-08-27rustc_target: add lifetime parameter to `LayoutOf`.Eduard-Mihai Burtescu-1/+1
2021-08-26reviewlcnr-4/+4
2021-08-26update `TypeFlags` to deal with missing ct substslcnr-5/+6
2021-08-26make unevaluated const substs optionallcnr-1/+1
2021-08-22Fix typos “an”→“a” and a few different ones that appeared in the ↵Frank Steffahn-1/+1
same search
2021-07-16get rid of incorrect erase_for_fmtRalf Jung-2/+2
2021-07-15adjustions and cleanup to make Miri build againRalf Jung-1/+1
2021-07-14consistently treat None-tagged pointers as ints; get rid of some deprecated ↵Ralf Jung-4/+3
Scalar methods
2021-07-14CTFE/Miri engine Pointer type overhaul: make Scalar-to-Pointer conversion ↵Ralf Jung-10/+4
infallible This resolves all the problems we had around "normalizing" the representation of a Scalar in case it carries a Pointer value: we can just use Pointer if we want to have a value taht we are sure is already normalized.
2021-07-03add note about MAX_ALLOC_LIMITSmittyvb-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-07-02Allocation failure in constprop panics right awaySmitty-0/+1
2021-06-30Delay ICE on evaluation failSmitty-68/+15
2021-06-30Properly evaluate non-consts in const propSmitty-8/+51
2021-06-30Simplify memory failure checkingSmitty-17/+16
2021-06-30Rename is_spurious -> is_volatileSmitty-2/+2
2021-06-29Properly handle const prop failuresSmitty-0/+13
2021-06-29Simplify const_prop logicSmitty-11/+9
2021-06-29Support allocation failures when interperting MIRSmitty-7/+11
Note that this breaks Miri. Closes #79601
2021-06-17Use `map_or` instead of open-coding itLingMan-6/+3
2021-06-16Stop returning a value from `report_assert_as_lint`LingMan-11/+14
This function only ever returns `None`. Make that explicity by not returning a value at all.
2021-05-23Pass `StackPopUnwind` to `eval_fn_call()` and some other functions that are ↵hyd-dev-2/+3
called by `eval_fn_call()`
2021-04-20TidyOli Scherer-3/+3
2021-04-20Implement a lint that highlights all moves larger than 1000 bytesOli Scherer-13/+2
2021-03-20extract `ConstKind::Unevaluated` into a structlcnr-1/+5
2021-03-15s/ConstantSource/ConstantKind/Oli Scherer-6/+6
2021-03-12Prepare mir::Constant for ty::Const only supporting valtreesOli Scherer-21/+31
2021-03-08Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelixbors-4/+5
Test the effect of shrinking the size of Rvalue by 16 bytes r? `@ghost`
2021-03-05Bump one missing mir_opt_levelSantiago Pastorino-1/+1
2021-03-05Bump all mir_opt_level 2 to 3Santiago Pastorino-2/+2
2021-03-05Bump all mir_opt_level 3 to 4Santiago Pastorino-2/+2
2021-03-05Extract mir_opt_level to a method and use Option to be able to know if the ↵Santiago Pastorino-3/+3
value is provided or not
2021-03-05Shrink the size of Rvalue by 16 bytesOli Scherer-4/+5
2021-03-01Box generator-related Body fieldsDániel Buga-1/+1
2021-02-20all InterpError allocate now, so adjust alloc-error-checkRalf Jung-2/+2
2021-02-20Auto merge of #82124 - tmiasko:op-ty-ref, r=oli-obkbors-28/+28
Pass large interpreter types by reference, not value r? `@ghost`
2021-02-17Reduce size of InterpErrorInfo to 8 bytesTomasz Miąsko-1/+1
2021-02-16./x.py fmtTomasz Miąsko-3/+3
2021-02-16Pass PlaceTy by reference not valueTomasz Miąsko-9/+9
2021-02-16Pass OpTy by reference not valueTomasz Miąsko-17/+17
2021-01-23Make sure that const prop does not produce unsilenceable lints after inliningoli-1/+9
2021-01-17Copy body span instead of querying itDániel Buga-1/+1
2021-01-12Auto merge of #78407 - oli-obk:ub_checkable_ctfe, r=RalfJung,pnkfelixbors-0/+7
Make CTFE able to check for UB... ... by not doing any optimizations on the `const fn` MIR used in CTFE. This means we duplicate all `const fn`'s MIR now, once for CTFE, once for runtime. This PR is for checking the perf effect, so we have some data when talking about https://github.com/rust-lang/const-eval/blob/master/rfcs/0000-const-ub.md To do this, we now have two queries for obtaining mir: `optimized_mir` and `mir_for_ctfe`. It is now illegal to invoke `optimized_mir` to obtain the MIR of a const/static item's initializer, an array length, an inline const expression or an enum discriminant initializer. For `const fn`, both `optimized_mir` and `mir_for_ctfe` work, the former returning the MIR that LLVM should use if the function is called at runtime. Similarly it is illegal to invoke `mir_for_ctfe` on regular functions. This is all checked via appropriate assertions and I don't think it is easy to get wrong, as there should be no `mir_for_ctfe` calls outside the const evaluator or metadata encoding. Almost all rustc devs should keep using `optimized_mir` (or `instance_mir` for that matter).
2021-01-10Add ABI argument to `find_mir_or_eval_fn`Nym Seddon-0/+2
Add ABI argument for called function in `find_mir_or_eval_fn` and `call_extra_fn`. Useful for comparing with expected ABI in interpreters. Related to [miri/1631](https://github.com/rust-lang/miri/issues/1631)
2021-01-04Move MIR body loading to a machine functionoli-0/+7
2020-12-03move interpret::MemoryKind::Heap to const evalVishnunarayan K I-0/+2