about summary refs log tree commit diff
path: root/tests/mir-opt
AgeCommit message (Collapse)AuthorLines
2023-10-19FileCheck combine_array_len.Camille GILLOT-2/+3
2023-10-19Add README.Camille GILLOT-0/+16
2023-10-19FileCheck box_expr.rsCamille GILLOT-145/+104
This check is made `needs-unwind`, as the panic=abort case is a strictly simpler version.
2023-10-19FileCheck basic_assignment.rs.Camille GILLOT-3/+20
2023-10-19FileCheck asm_unwind_panic_abort.rsCamille GILLOT-1/+3
2023-10-19FileCheck array_index_is_temporary.rsCamille GILLOT-1/+7
2023-10-19Run filecheck on reference_prop.rsCamille GILLOT-16/+318
2023-10-19Allow to run filecheck in mir-opt tests.Camille GILLOT-190/+470
2023-10-19Rollup merge of #116896 - cjgillot:single-inline, r=oli-obkMatthias Krüger-0/+19
Only check in a single place if a pass is enabled. Fixes https://github.com/rust-lang/rust/issues/116294
2023-10-18Only check in a single place if a pass is enabled.Camille GILLOT-0/+19
2023-10-18coverage: Store expression data in function coverage infoZalathar-2/+4
Even though expression details are now stored in the info structure, we still need to inject `ExpressionUsed` statements into MIR, because if one is missing during codegen then we know that it was optimized out and we can remap all of its associated code regions to zero.
2023-10-18coverage: Store all of a function's mappings in function coverage infoZalathar-5/+13
Previously, mappings were attached to individual coverage statements in MIR. That necessitated special handling in MIR optimizations to avoid deleting those statements, since otherwise codegen would be unable to reassemble the original list of mappings. With this change, a function's list of mappings is now attached to its MIR body, and survives intact even if individual statements are deleted by optimizations.
2023-10-17Automatically enable cross-crate inlining for small functionsBen Kimock-237/+193
2023-10-16Stop trying to preserve pretty-printing.Camille GILLOT-112/+112
2023-10-16Rebless.Camille GILLOT-34/+34
2023-10-16Normalize alloc-id in tests.Camille GILLOT-218/+218
2023-10-13Clean up unchecked_math, separate out unchecked_shiftsltdk-1/+1
2023-10-08Also consider call and yield as MIR SSA.Camille GILLOT-80/+152
2023-10-06Preserve DebugInfo in DeadStoreElimination.Camille GILLOT-790/+721
2023-10-05move subtyper change reveal_allouz-a-52/+44
2023-10-04Remove mir::LocalDecl::internal.Camille GILLOT-0/+92
2023-10-03Auto merge of #115301 - Zalathar:regions-vec, r=davidtwcobors-6/+5
coverage: Allow each coverage statement to have multiple code regions The original implementation of coverage instrumentation was built around the assumption that a coverage counter/expression would be associated with *up to one* code region. When it was discovered that *multiple* regions would sometimes need to share a counter, a workaround was found: for the remaining regions, the instrumentor would create a fresh expression that adds zero to the existing counter/expression. That got the job done, but resulted in some awkward code, and produces unnecessarily complicated coverage maps in the final binary. --- This PR removes that tension by changing `StatementKind::Coverage`'s code region field from `Option<CodeRegion>` to `Vec<CodeRegion>`. The changes on the codegen side are fairly straightforward. As long as each `CoverageKind::Counter` only injects one `llvm.instrprof.increment`, the rest of coverage codegen is happy to handle multiple regions mapped to the same counter/expression, with only minor option-to-vec adjustments. On the instrumentor/mir-transform side, we can get rid of the code that creates extra (x + 0) expressions. Instead we gather all of the code regions associated with a single BCB, and inject them all into one coverage statement. --- There are several patches here but they can be divided in to three phases: - Preparatory work - Actually switching over to multiple regions per coverage statement - Cleaning up So viewing the patches individually may be easier.
2023-10-03coverage: Store each BCB's code regions in one coverage statementZalathar-2/+1
If a BCB has more than one code region, those extra regions can now all be stored in the same coverage statement, instead of being stored in additional statements.
2023-10-03coverage: Let each coverage statement hold a vector of code regionsZalathar-6/+6
This makes it possible for a `StatementKind::Coverage` to hold more than one code region, but that capability is not yet used.
2023-10-02have better explanation for `relate_types`ouz-a-8/+4
2023-10-02change is_subtype to relate_typesouz-a-47/+53
2023-10-02Add docs, remove code, change subtyper codeouz-a-310/+9
2023-10-02subtyping_projectionsouz-a-2/+309
2023-09-29Auto merge of #115759 - oli-obk:open_drop_from_non-ADT, r=lcnrbors-53/+83
Reveal opaque types before drop elaboration fixes https://github.com/rust-lang/rust/issues/113594 r? `@cjgillot` cc `@JakobDegen` This pass was introduced in https://github.com/rust-lang/rust/pull/110714 I moved it before drop elaboration (which only cares about the hidden types of things, not the opaque TAIT or RPIT type) and set it to run unconditionally (instead of depending on the optimization level and whether the inliner is active)
2023-09-28Add test for 116212.Camille GILLOT-0/+14
2023-09-28Bless mir-opt testsOli Scherer-40/+46
2023-09-28Unconditionally run `RevealAll` pass and run it earlierOli Scherer-13/+37
2023-09-24Do not clone valtree and slice constants.Camille GILLOT-0/+574
2023-09-24Embed simplification into VnState.Camille GILLOT-24/+24
2023-09-24Do not check copiability.Camille GILLOT-18/+20
2023-09-24Add global value numbering pass.Camille GILLOT-23/+6040
2023-09-24Auto merge of #115794 - cjgillot:aggregate-no-box, r=davidtwcobors-0/+953
Do not create a DerefLen place for `Box<[T]>`. Fixes https://github.com/rust-lang/rust/issues/115789
2023-09-23Bless mir-optCamille GILLOT-61/+90
2023-09-22Auto merge of #115696 - RalfJung:closure-ty-print, r=oli-obkbors-75/+75
adjust how closure/generator types are printed I saw `&[closure@$DIR/issue-20862.rs:2:5]` and I thought it is a slice type, because that's usually what `&[_]` is... it took me a while to realize that this is just a confusing printer and actually there's no slice. Let's use something that cannot be mistaken for a regular type.
2023-09-21adjust how closure/generator types and rvalues are printedRalf Jung-75/+75
2023-09-21Rollup merge of #115972 - RalfJung:const-consistency, r=oli-obkGuillaume Gomez-4/+4
rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const Also, be more consistent with the `to/eval_bits` methods... we had some that take a type and some that take a size, and then sometimes the one that takes a type is called `bits_for_ty`. Turns out that `ty::Const`/`mir::ConstKind` carry their type with them, so we don't need to even pass the type to those `eval_bits` functions at all. However this is not properly consistent yet: in `ty` we have most of the methods on `ty::Const`, but in `mir` we have them on `mir::ConstKind`. And indeed those two types are the ones that correspond to each other. So `mir::ConstantKind` should actually be renamed to `mir::Const`. But what to do with `mir::Constant`? It carries around a span, that's really more like a constant operand that appears as a MIR operand... it's more suited for `syntax.rs` than `consts.rs`, but the bigger question is, which name should it get if we want to align the `mir` and `ty` types? `ConstOperand`? `ConstOp`? `Literal`? It's not a literal but it has a field called `literal` so it would at least be consistently wrong-ish... ``@oli-obk`` any ideas?
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-4/+4
2023-09-20Ignore debug-assertions in test.Camille GILLOT-0/+1
2023-09-20Do not create a DerefLen place for `Box<[T]>`.Camille GILLOT-0/+952
2023-09-20coverage: Remove debug code from the instrumentorZalathar-39/+0
2023-09-19Auto merge of #115865 - RalfJung:mir-mod, r=oli-obkbors-2/+2
move things out of mir/mod.rs This moves a bunch of things out of `mir/mod.rs`: - all const-related stuff to a new file consts.rs - all statement/place/operand-related stuff to a new file statement.rs - all pretty-printing related stuff to pretty.rs `mod.rs` started out with 3100 lines and ends up with 1600. :) Also there was some pretty-printing stuff in terminator.rs, that also got moved to pretty.rs, and I reordered things in pretty.rs so that it can be grouped by functionality. Only the commit "use pretty_print_const_value from MIR constant 'extra' printing" has any behavior changes; it resolves the issue of having a fancy and a very crude pretty-printer for `ConstValue`. r? `@oli-obk`
2023-09-19use pretty_print_const_value from MIR constant 'extra' printingRalf Jung-2/+2
2023-09-19Don't resolve generic instances if they may be shadowed by dynMichael Goulet-19/+43
2023-09-19Failing testMichael Goulet-0/+52
2023-09-18make more prettyBoxy-15/+3