about summary refs log tree commit diff
path: root/tests/mir-opt/const_prop
AgeCommit message (Collapse)AuthorLines
2023-09-14bless allRalf Jung-0/+120
2023-09-06Support array length.Camille GILLOT-16/+13
2023-08-25Remove some wasm/emscripten ignoresBen Kimock-2/+0
2023-07-20Propagate ScalarPair for any type.Camille GILLOT-8/+14
2023-07-20Also propagate ScalarPair operands.Camille GILLOT-6/+12
2023-07-20Always propagate into operands.Camille GILLOT-49/+68
2023-07-07Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`Nilstrieb-9/+9
It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum.
2023-06-23Bless testsGary Guo-60/+60
2023-06-21Warn on unused offset_of!() resultChayim Refael Friedman-84/+281
2023-06-15Remove comments from mir-opt MIR dumpsBen Kimock-2295/+2118
2023-06-12bless mir-optPietro Albini-0/+1304
To reproduce the changes in this commit locally: - Run `./x test tidy` and remove all the output files not associated with a test file anymore, as reported by tidy. - Run `./x test tests/mir-opt --bless` to generate the new outputs.
2023-06-12properly mark tests that require panic=abortPietro Albini-22/+22
2023-05-19Drive-by-cleanup: Don't emit `thir::ExprKind::NeverToAny` for `! -> !`Maybe Waffle-82/+52
2023-05-09Rollup merge of #110694 - est31:builtin, r=petrochenkovDylan DPC-12/+12
Implement builtin # syntax and use it for offset_of!(...) Add `builtin #` syntax to the parser, as well as a generic infrastructure to support both item and expression position builtin syntaxes. The PR also uses this infrastructure for the implementation of the `offset_of!` macro, added by #106934. cc `@petrochenkov` `@DrMeepster` cc #110680 `builtin #` tracking issue cc #106655 `offset_of!` tracking issue
2023-05-08Auto merge of #110824 - cjgillot:const-prop-index, r=JakobDegen,oli-obkbors-4/+8
ConstProp into PlaceElem::Index. Noticed this while looking at keccak output MIR. This pass aims to replace `ProjectionElem::Index` with `ProjectionElem::ConstantIndex` during ConstProp. r? `@ghost`
2023-05-08Auto merge of #111309 - saethlin:InstSimplify, r=scottmcmbors-1/+1
Rename InstCombine to InstSimplify ``` ╭ ➜ ben@archlinux:~/rust ╰ ➤ rg -i instcombine src/doc/rustc-dev-guide/src/mir/optimizations.md 134:may have been misapplied. Examples of this are `InstCombine` and `ConstantPropagation`. src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/llvm-config.sh 38: instcombine instrumentation interpreter ipo irreader lanai \ tests/codegen/slice_as_from_ptr_range.rs 4:// min-llvm-version: 15.0 (because this is a relatively new instcombine) ``` r? `@scottmcm`
2023-05-07Propagate PlaceElem::Index.Camille GILLOT-4/+8
2023-05-06Rename InstCombine to InstSimplifyBen Kimock-1/+1
2023-05-06Rollup merge of #111077 - cjgillot:const-prop-unit, r=Mark-SimulacrumMatthias Krüger-79/+226
Make more ConstProp tests unit.
2023-05-05Migrate offset_of from a macro to builtin # syntaxest31-12/+12
2023-05-04Reject borrows of projections in ConstProp.Camille GILLOT-10/+5
2023-05-04Add tests.Camille GILLOT-0/+68
2023-05-02Make ConstProp tests unit.Camille GILLOT-79/+226
2023-05-02Auto merge of #109521 - tmiasko:const-prop-validation, r=wesleywiserbors-5/+236
Don't validate constants in const propagation Validation is neither necessary nor desirable. The constant validation is already omitted at mir-opt-level >= 3, so there there are not changes in MIR test output (the propagation of invalid constants is covered by an existing test in tests/mir-opt/const_prop/invalid_constant.rs).
2023-04-30Rollup merge of #110732 - cjgillot:unit-const-prop, r=tmiaskoMatthias Krüger-75/+79
Make ConstProp some tests unit. Part of the effort to tidy up mir-opt test suite.
2023-04-27Use EMIT_MIR_FOR_EACH_BIT_WIDTH in transmute mir-opt testTomasz Miąsko-0/+217
2023-04-27Remove workaround for CastKind::Transmute from const propTomasz Miąsko-5/+19
Since constants are no longer validated before propagation the workaround is obsolete. Remove it.
2023-04-23Make some tests unit.Camille GILLOT-75/+79
2023-04-23Add mir-opt tests to track MIR quality.Camille GILLOT-351/+0
2023-04-22Turn on ConstDebugInfo pass.Wesley Wiser-40/+12
2023-04-21test improvementsDrMeepster-22/+85
2023-04-21offset_ofDrMeepster-0/+68
2023-04-06Ignore many tests on wasm32Gary Guo-19/+41
2023-03-22Add `CastKind::Transmute` to MIRScott McMurray-0/+262
Updates `interpret`, `codegen_ssa`, and `codegen_cranelift` to consume the new cast instead of the intrinsic. Includes `CastTransmute` for custom MIR building, to be able to test the extra UB.
2023-03-13Generalize operation.Camille GILLOT-15/+12
2023-03-13Replace ZST operands and debuginfo by constants.Camille GILLOT-12/+74
2023-03-13Auto merge of #108471 - clubby789:unbox-the-syntax, r=Nilstrieb,est31bors-35/+37
Remove `box_syntax` r? `@Nilstrieb` This removes the feature `box_syntax`, which allows the use of `box <expr>` to create a Box, and finalises removing use of the feature from the compiler. `box_patterns` (allowing the use of `box <pat>` in a pattern) is unaffected. It also removes `ast::ExprKind::Box` - the only way to create a 'box' expression now is with the rustc-internal `#[rustc_box]` attribute. As a temporary measure to help users move away, `box <expr>` now parses the inner expression, and emits a `MachineApplicable` lint to replace it with `Box::new` Closes #49733
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-35/+37
2023-03-08Bless 32bit.Camille GILLOT-1/+1
2023-03-08Remove OnlyPropagateInto.Camille GILLOT-3/+5
2023-03-08Do not track span in ConstProp.Camille GILLOT-3/+3
2023-02-18Remove overflow checks from ConstProp.Camille GILLOT-1/+50
2023-02-05Bless 32bit tests.Camille GILLOT-19/+21
2023-02-05Run SROA to fixpoint.Camille GILLOT-15/+12
2023-02-05Simplify construction of replacement map.Camille GILLOT-17/+30
2023-02-05Fix SROA without deaggregation.Camille GILLOT-41/+36
2023-02-02Add partial propagation test.Camille GILLOT-20/+162
2023-02-02Bless tests.Camille GILLOT-85/+46
2023-02-02Stop deaggregating enums in MIR.Camille GILLOT-29/+21
2023-02-02Rollup merge of #107524 - cjgillot:both-storage, r=RalfJungMatthias Krüger-2/+0
Remove both StorageLive and StorageDead in CopyProp. Fixes https://github.com/rust-lang/rust/issues/107511 https://github.com/rust-lang/rust/pull/106908 removed StorageDead without the accompanying StorageLive. In loops, execution would see repeated StorageLive, without any StorageDead, which is UB. So when removing storage statements, we have to remove both StorageLive and StorageDead. ~I also added a MIR validation pass for StorageLive. It may be a bit overzealous.~