about summary refs log tree commit diff
path: root/tests/mir-opt/inline
AgeCommit message (Collapse)AuthorLines
2024-02-12Start blocks eagerlyNadrieril-12/+12
2024-02-08Bless/fix testsBen Kimock-73/+87
2024-02-06Use a better set of targets for blessing mir-opt testsBen Kimock-53/+13
2024-01-16Rename `pointer` field on `Pin`LegionMammal978-2/+2
The internal, unstable field of `Pin` can conflict with fields from the inner type accessed via the `Deref` impl. Rename it from `pointer` to `__pointer`, to make it less likely to conflict with anything else.
2024-01-11Sandwich MIR optimizations between DSE.Camille GILLOT-6/+6
2024-01-04Rollup merge of #119325 - RalfJung:custom-mir, r=compiler-errorsMatthias Krüger-1/+1
custom mir: make it clear what the return block is Custom MIR recently got support for specifying the "unwind action", so now there's two things coming after the actual call part of `Call` terminators. That's not very self-explaining so I propose we change the syntax to imitate keyword arguments: ``` Call(popped = Vec::pop(v), ReturnTo(drop), UnwindContinue()) ``` Also fix some outdated docs and add some docs to `Call` and `Drop`.
2023-12-30Update to bitflags 2 in the compilerNilstrieb-1/+1
This involves lots of breaking changes. There are two big changes that force changes. The first is that the bitflag types now don't automatically implement normal derive traits, so we need to derive them manually. Additionally, bitflags now have a hidden inner type by default, which breaks our custom derives. The bitflags docs recommend using the impl form in these cases, which I did.
2023-12-26custom mir: make it clear what the return block isRalf Jung-1/+1
2023-12-24Enable GVN by default.Camille GILLOT-2/+2
2023-12-11End locals' live range before suspending coroutineTomasz Miąsko-0/+2
State transforms retains storage statements for locals that are not stored inside a coroutine. It ensures those locals are live when resuming by inserting StorageLive as appropriate. It forgot to end the storage of those locals when suspending, which is fixed here. While the end of live range is implicit when executing return, it is nevertheless useful for inliner which would otherwise extend the live range beyond return.
2023-11-20Fix insertion of statements to be executed along return edge in inliningTomasz Miąsko-533/+135
Inlining creates additional statements to be executed along the return edge: an assignment to the destination, storage end for temporaries. Previously those statements where inserted directly into a call target, but this is incorrect when the target has other predecessors. Avoid the issue by creating a new dedicated block for those statements. When the block happens to be redundant it will be removed by CFG simplification that follows inlining. Fixes #117355
2023-11-01Auto merge of #117029 - rmehri01:mir_opt_filecheck_inline_tests, r=cjgillotbors-51/+156
Add FileCheck annotations to MIR-opt inlining tests Part of #116971, adds FileCheck annotations to MIR-opt tests in `tests/mir-opt/inline`. I left out a few (such as `inline_cycle`) where it mentioned that the particular outcome of inlining isn't important, just that the inliner doesn't get stuck in an infinite loop. r? cjgillot
2023-11-01fix spans for inline_couroutine panic-abortRyan Mehri-11/+11
2023-11-01Rollup merge of #115626 - clarfonthey:unchecked-math, r=thomccMatthias Krüger-1/+1
Clean up unchecked_math, separate out unchecked_shifts Tracking issue: #85122 Changes: 1. Remove `const_inherent_unchecked_arith` flag and make const-stability flags the same as the method feature flags. Given the number of other unsafe const fns already stabilised, it makes sense to just stabilise these in const context when they're stabilised. 2. Move `unchecked_shl` and `unchecked_shr` into a separate `unchecked_shifts` flag, since the semantics for them are unclear and they'll likely be stabilised separately as a result. 3. Add an `unchecked_neg` method exclusively to signed integers, under the `unchecked_neg` flag. This is because it's a new API and probably needs some time to marinate before it's stabilised, and while it *would* make sense to have a similar version for unsigned integers since `checked_neg` also exists for those there is absolutely no case where that would be a good idea, IMQHO. The longer-term goal here is to prepare the `unchecked_math` methods for an FCP and stabilisation since they've existed for a while, their semantics are clear, and people seem in favour of stabilising them.
2023-10-31change inline_retag to after.mirRyan Mehri-66/+60
2023-10-31Only emit `!=` assumptions if the otherwise target is reachable.Camille GILLOT-32/+12
2023-10-31Simplify assume of a constant.Camille GILLOT-70/+56
2023-10-31Replace SwitchInt to unreachable by an assumption.Camille GILLOT-16/+44
2023-10-25address review commentsRyan Mehri-70/+100
2023-10-25FileCheck unwrap_uncheckedRyan Mehri-1/+2
2023-10-25FileCheck unsized_argumentRyan Mehri-1/+2
2023-10-25FileCheck unchecked_shiftsRyan Mehri-1/+8
2023-10-25FileCheck issue_78442Ryan Mehri-1/+5
2023-10-25FileCheck inline_scopes_parentingRyan Mehri-4/+8
2023-10-25FileCheck inline_as_ref_as_mutRyan Mehri-1/+8
2023-10-25FileCheck inline_trait_methodRyan Mehri-1/+2
2023-10-25FileCheck inline_trait_method_2Ryan Mehri-1/+3
2023-10-25FileCheck inline_specializationRyan Mehri-1/+2
2023-10-25FileCheck inline_retagRyan Mehri-1/+2
2023-10-25FileCheck inline_optionsRyan Mehri-1/+3
2023-10-25FileCheck inline_into_box_placeRyan Mehri-1/+2
2023-10-25FileCheck inline_instruction_setRyan Mehri-1/+10
2023-10-25FileCheck inline_coroutineRyan Mehri-12/+14
2023-10-25FileCheck inline_divergingRyan Mehri-1/+7
2023-10-25FileCheck inline_closureRyan Mehri-1/+3
2023-10-25FileCheck inline_closure_capturesRyan Mehri-1/+3
2023-10-25FileCheck inline_closure_borrows_argRyan Mehri-1/+3
2023-10-25FileCheck inline_box_fnRyan Mehri-1/+2
2023-10-25FileCheck inline_any_operandRyan Mehri-1/+2
2023-10-25FileCheck exponential_runtimeRyan Mehri-1/+8
2023-10-25FileCheck dyn_traitRyan Mehri-1/+8
2023-10-25FileCheck dont_ice_on_generic_rust_callRyan Mehri-1/+2
2023-10-25FileCheck cycleRyan Mehri-1/+8
2023-10-25FileCheck caller_with_trivial_boundRyan Mehri-1/+2
2023-10-25FileCheck asm_unwindRyan Mehri-1/+2
2023-10-24Require target features to match exactly during inliningTomasz Miąsko-1/+1
In general it is not correct to inline a callee with a target features that are subset of the callee. Require target features to match exactly during inlining. The exact match could be potentially relaxed, but this would require identifying specific feature that are allowed to differ, those that need to match, and those that can be present in caller but not in callee. This resolves MIR part of #116573. For other concerns with respect to the previous implementation also see areInlineCompatible in LLVM.
2023-10-24Precommit target features compatibility testTomasz Miąsko-0/+8
2023-10-24Migrate inline_compatibility.rs test to FileCheckTomasz Miąsko-226/+34
2023-10-21Do not create move paths that do not need dropping.Camille GILLOT-16/+8
2023-10-20s/generator/coroutine/Oli Scherer-27/+27