about summary refs log tree commit diff
path: root/src/test/mir-opt/inline
AgeCommit message (Collapse)AuthorLines
2020-11-15Limit storage duration of inlined always live localsTomasz Miąsko-0/+9
2020-11-12./x.py test --blessTomasz Miąsko-36/+184
2020-11-12Never inline C variadic functionsTomasz Miąsko-0/+18
2020-11-12Fix generator inlining by checking for rust-call abi and spread argTomasz Miąsko-0/+16
2020-11-12Never inline when `no_sanitize` attributes differTomasz Miąsko-3/+1
The inliner looks if a sanitizer is enabled before considering `no_sanitize` attribute as possible source of incompatibility. The MIR inlining could happen in a crate with sanitizer disabled, but code generation in a crate with sanitizer enabled, thus the attribute would be incorrectly ignored. To avoid the issue never inline functions with different `no_sanitize` attributes.
2020-11-11Rollup merge of #78899 - tmiasko:inline-diverging, r=oli-obkJonas Schievink-0/+180
Support inlining diverging function calls The existing heuristic does penalize diverging calls to some degree, but since it never inlined them previously it might need some further modifications. Additionally introduce storage markers for all temporaries created by the inliner. The temporary introduced for destination rebrorrow, didn't use them previously.
2020-11-10Add flags customizing behaviour of MIR inliningTomasz Miąsko-0/+75
* `-Zinline-mir-threshold` to change the default threshold. * `-Zinline-mir-hint-threshold` to change the threshold used by functions with inline hint.
2020-11-09Support inlining diverging function callsTomasz Miąsko-0/+180
Additionally introduce storage markers for all temporaries created by the inliner. The temporary introduced for destination rebrorrow, didn't use them previously.
2020-11-09inliner: Break inlining cyclesTomasz Miąsko-0/+134
When examining candidates for inlining, reject those that are determined to be recursive either because of self-recursive calls or calls to any instances already inlined.
2020-11-06inliner: Use substs_for_mir_bodyTomasz Miąsko-0/+91
Changes from 68965 extended the kind of instances that are being inlined. For some of those, the `instance_mir` returns a MIR body that is already expressed in terms of the types found in substitution array, and doesn't need further substitution. Use `substs_for_mir_body` to take that into account.
2020-10-27Show the inline stack of MIR lints that only occur after inliningOliver Scherer-87/+87
2020-10-26Auto merge of #77187 - TimDiekmann:box-alloc, r=Amanieubors-4/+4
Support custom allocators in `Box` r? `@Amanieu` This pull request requires a crater run. ### Prior work: - #71873 - #58457 - [`alloc-wg`](https://github.com/TimDiekmann/alloc-wg)-crate Currently blocked on: - ~#77118~ - ~https://github.com/rust-lang/chalk/issues/615 (#77515)~
2020-10-21rustc_mir: create the Integrator as soon as possible in MIR inlining.Eduard-Mihai Burtescu-52/+52
2020-10-21rustc_mir: don't throw away inlined locals' spans.Eduard-Mihai Burtescu-11/+11
2020-10-21rustc_mir: properly map scope parent chains into the caller when inlining.Eduard-Mihai Burtescu-3/+51
2020-10-21rustc_mir: track inlined callees in SourceScopeData.Eduard-Mihai Burtescu-15/+15
2020-10-07Fix mir-opt output for 32 bitTim Diekmann-2/+2
2020-10-07Support custom allocators in `Box`Tim Diekmann-2/+2
Remove `Box::leak_with_alloc` Add leak-test for box with allocator Rename `AllocErr` to `AllocError` in leak-test Add `Box::alloc` and adjust examples to use the new API
2020-10-04Bless mir-opt testsAaron Hill-36/+34
2020-09-30Auto merge of #77069 - sexxi-goose:closure_print_2, r=nikomatsakisbors-2/+2
pretty.rs: Update Closure and Generator print More detailed outline: https://github.com/rust-lang/project-rfc-2229/pull/17 Closes: https://github.com/rust-lang/project-rfc-2229/issues/11 r? `@nikomatsakis` cc `@eddyb` `@davidtwco` `@estebank`
2020-09-28pretty.rs: Update Closure and Generator printAman Arora-2/+2
Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com> Co-authored-by: Logan Mosier <logmosier@gmail.com>
2020-09-27Remove unnecessary -Zunsound-mir-opts uses in testsWesley Wiser-13/+25
2020-09-27[mir-opt] Introduce a new flag to enable experimental/unsound mir optsWesley Wiser-3/+3
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-10/+10
2020-09-21Add optimization to avoid load of addressSimon Vandel Sillesen-8/+12
2020-09-18Bless mir-opt testsJonas Schievink-14/+10
2020-09-17Rename 32 bit mir files to be more tool friendlyNixon Enraght-Moony-0/+0
See #75746
2020-09-17Rename 64 bit mir files to be more tool friendlyNixon Enraght-Moony-0/+0
See #75746
2020-09-14Auto merge of #76123 - tmiasko:inline-args-storage, r=wesleywiserbors-0/+14
inliner: Emit storage markers for introduced arg temporaries When introducing argument temporaries during inlining, emit storage marker statements just before the assignment and in the beginning of the return block. This ensures that such temporaries will not be considered live across yield points after inlining inside a generator. Fixes #71793.
2020-09-04inliner: Add mir-opt tests for codegen attributes compatibilityTomasz Miąsko-0/+133
2020-09-03Auto merge of #73996 - da-x:short-unique-paths, r=petrochenkovbors-9/+9
diagnostics: shorten paths of unique symbols This is a step towards implementing a fix for #50310, and continuation of the discussion in [Pre-RFC: Nicer Types In Diagnostics - compiler - Rust Internals](https://internals.rust-lang.org/t/pre-rfc-nicer-types-in-diagnostics/11139). Impressed upon me from previous discussion in #21934 that an RFC for this is not needed, and I should just come up with code. The recent improvements to `use` suggestions that I've contributed have given rise to this implementation. Contrary to previous suggestions, it's rather simple logic, and I believe it only reduces the amount of cognitive load that a developer would need when reading type errors. ----- If a symbol name can only be imported from one place, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path to the last component. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable from anywhere.
2020-09-03inliner: Emit storage markers for introduced arg temporariesTomasz Miąsko-0/+14
When introducing argument temporaries during inlining, emit storage marker statements just before the assignment and in the beginning of the return block. This ensures that such temporaries will not be considered live across yield points after inlining inside a generator.
2020-09-02pretty: trim paths of unique symbolsDan Aloni-9/+9
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-09-02inliner: Avoid query cycles when optimizing generatorsTomasz Miąsko-0/+18
The HIR Id trick is insufficient to prevent query cycles when optimizing generators, since merely requesting a layout of a generator also computes its `optimized_mir`. Make no attempts to inline functions into generators within the same crate to avoid query cycles.
2020-08-21Suppress "const" prefix of FnDef in MIR dumpLzu Tao-9/+9
2020-08-20Suppress MIR comments of Unit typeLzu Tao-56/+34
2020-08-20Suppress MIR comments for FnDef in ty::ConstLzu Tao-27/+2
2020-08-17Update MIR tests with comment verbosity fixAustin Lasher-31/+3
2020-08-11move Deaggregate pass to post_borrowck_cleanupRalf Jung-30/+7
2020-07-31compiletest: ignore-endian-big, fixes #74829, fixes #74885Ximin Luo-1/+1
2020-07-29Move mir-opt tests to toplevelXavier Denis-0/+0
2020-07-29add crate name to mir dumpsXavier Denis-13/+13
2020-07-27mv std libs to library/mark-25/+25
2020-07-15improve namingBastian Kauschke-4/+4
2020-07-15mir opt diffBastian Kauschke-4/+4
2020-06-26Show the values and computation that would overflow a const evaluation or ↵Oliver Scherer-7/+7
propagation
2020-06-04Revert "Bless mir-opt tests"Felix S. Klock II-28/+34
This reverts commit a030c923412b0a0f7b02a585debe7bf60357370d.
2020-05-31InstCombine: Don't optimize `&mut *x` into `x`Jonas Schievink-3/+11
2020-05-25Avoid `Operand::Copy` with `&mut T`Jonas Schievink-2/+2
2020-05-24Clear MIR local type annotations after borrowckJonas Schievink-2/+2