Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mir-opt tests generate an excessive amount of output #109502

Closed
scottmcm opened this issue Mar 22, 2023 · 9 comments
Closed

mir-opt tests generate an excessive amount of output #109502

scottmcm opened this issue Mar 22, 2023 · 9 comments
Assignees
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-mir-opt Area: MIR optimizations A-testsuite Area: The testsuite used to check the correctness of rustc E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@scottmcm
Copy link
Member

scottmcm commented Mar 22, 2023

There are 237 mir-opt tests right now.

Running them on my machine produces over 69 thousand files, using over 400 MB of disk (⅓ of which is filesystem overhead):
image

Could that be cut back somewhat? Windows is not a fan of lots of files -- even just deleting all those files takes over 13 seconds, despite being on a fast M2 PCI-e SSD.

@scottmcm scottmcm added A-mir-opt Area: MIR optimizations A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself labels Mar 23, 2023
@jyn514 jyn514 added the A-testsuite Area: The testsuite used to check the correctness of rustc label Mar 25, 2023
@jyn514
Copy link
Member

jyn514 commented Mar 25, 2023

Looks like currently we pass -Zdump-mir=all, which generates a file for each MIR pass within each test:

"-Zdump-mir=all",

dumped files
; ls build/host/test/mir-opt/building/simple_match/
core.ops-function-FnOnce-call_once.AbortUnwindingCalls.after.mir      simple_match.main.nll.0.regioncx.all.dot
core.ops-function-FnOnce-call_once.AbortUnwindingCalls.before.mir     simple_match.main.nll.0.regioncx.scc.dot
core.ops-function-FnOnce-call_once.AddCallGuards.after.mir            simple_match.main.NormalizeArrayLen.after.mir
core.ops-function-FnOnce-call_once.AddCallGuards.before.mir           simple_match.main.NormalizeArrayLen.before.mir
core.ops-function-FnOnce-call_once.AddMovesForPackedDrops.after.mir   simple_match.main.PreCodegen.after.mir
core.ops-function-FnOnce-call_once.AddMovesForPackedDrops.before.mir  simple_match.main.PreCodegen.before.mir
core.ops-function-FnOnce-call_once.Derefer.after.mir                  simple_match.main.PromoteTemps.after.mir
core.ops-function-FnOnce-call_once.Derefer.before.mir                 simple_match.main.PromoteTemps.before.mir
core.ops-function-FnOnce-call_once.RemoveNoopLandingPads.after.mir    simple_match.main.RemoveNoopLandingPads.after.mir
core.ops-function-FnOnce-call_once.RemoveNoopLandingPads.before.mir   simple_match.main.RemoveNoopLandingPads.before.mir
core.ops-function-FnOnce-call_once.runtime-optimized.after.mir        simple_match.main.RemoveStorageMarkers.after.mir
core.ops-function-FnOnce-call_once.SimplifyCfg-make_shim.after.mir    simple_match.main.RemoveStorageMarkers.before.mir
core.ops-function-FnOnce-call_once.SimplifyCfg-make_shim.before.mir   simple_match.main.RemoveUnneededDrops.after.mir
core.ptr-drop_in_place.AbortUnwindingCalls.after.mir                  simple_match.main.RemoveUnneededDrops.before.mir
core.ptr-drop_in_place.AbortUnwindingCalls.before.mir                 simple_match.main.RemoveZsts.after.mir
core.ptr-drop_in_place.AddCallGuards.after.mir                        simple_match.main.RemoveZsts.before.mir
core.ptr-drop_in_place.AddCallGuards.before.mir                       simple_match.main.RenameReturnPlace.after.mir
core.ptr-drop_in_place.AddMovesForPackedDrops.after.mir               simple_match.main.RenameReturnPlace.before.mir
core.ptr-drop_in_place.AddMovesForPackedDrops.before.mir              simple_match.main.renumber.0.mir
core.ptr-drop_in_place.Derefer.after.mir                              simple_match.main.RevealAll.after.mir
core.ptr-drop_in_place.Derefer.before.mir                             simple_match.main.RevealAll.before.mir
core.ptr-drop_in_place.RemoveNoopLandingPads.after.mir                simple_match.main.runtime.after.mir
core.ptr-drop_in_place.RemoveNoopLandingPads.before.mir               simple_match.main.runtime-optimized.after.mir
core.ptr-drop_in_place.runtime-optimized.after.mir                    simple_match.main.runtime-post-cleanup.after.mir
core.ptr-drop_in_place.SimplifyCfg-make_shim.after.mir                simple_match.main.SanityCheck.after.mir
core.ptr-drop_in_place.SimplifyCfg-make_shim.before.mir               simple_match.main.SanityCheck.before.mir
simple_match                                                          simple_match.main.ScalarReplacementOfAggregates.after.mir
simple_match.err                                                      simple_match.main.ScalarReplacementOfAggregates.before.mir
simple_match.main.AbortUnwindingCalls.after.mir                       simple_match.main.SeparateConstSwitch.after.mir
simple_match.main.AbortUnwindingCalls.before.mir                      simple_match.main.SeparateConstSwitch.before.mir
simple_match.main.AddCallGuards.after.mir                             simple_match.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
simple_match.main.AddCallGuards.before.mir                            simple_match.main.SimplifyCfg-after-uninhabited-enum-branching.before.mir
simple_match.main.AddMovesForPackedDrops.after.mir                    simple_match.main.SimplifyCfg-early-opt.after.mir
simple_match.main.AddMovesForPackedDrops.before.mir                   simple_match.main.SimplifyCfg-early-opt.before.mir
simple_match.main.analysis.after.mir                                  simple_match.main.SimplifyCfg-elaborate-drops.after.mir
simple_match.main.analysis-post-cleanup.after.mir                     simple_match.main.SimplifyCfg-elaborate-drops.before.mir
simple_match.main.built.after.mir                                     simple_match.main.SimplifyCfg-final.after.mir
simple_match.main.CleanupPostBorrowck.after.mir                       simple_match.main.SimplifyCfg-final.before.mir
simple_match.main.CleanupPostBorrowck.before.mir                      simple_match.main.SimplifyCfg-initial.after.mir
simple_match.main.ConstGoto.after.mir                                 simple_match.main.SimplifyCfg-initial.before.mir
simple_match.main.ConstGoto.before.mir                                simple_match.main.SimplifyCfg-promote-consts.after.mir
simple_match.main.ConstProp.after.mir                                 simple_match.main.SimplifyCfg-promote-consts.before.mir
simple_match.main.ConstProp.before.mir                                simple_match.main.SimplifyComparisonIntegral.after.mir
simple_match.main.CopyProp.after.mir                                  simple_match.main.SimplifyComparisonIntegral.before.mir
simple_match.main.CopyProp.before.mir                                 simple_match.main.SimplifyConstCondition-after-const-prop.after.mir
simple_match.main.DataflowConstProp.after.mir                         simple_match.main.SimplifyConstCondition-after-const-prop.before.mir
simple_match.main.DataflowConstProp.before.mir                        simple_match.main.SimplifyConstCondition-final.after.mir
simple_match.main.DeadStoreElimination.after.mir                      simple_match.main.SimplifyConstCondition-final.before.mir
simple_match.main.DeadStoreElimination.before.mir                     simple_match.main.SimplifyLocals-before-const-prop.after.mir
simple_match.main.DeduplicateBlocks.after.mir                         simple_match.main.SimplifyLocals-before-const-prop.before.mir
simple_match.main.DeduplicateBlocks.before.mir                        simple_match.main.SimplifyLocals-final.after.mir
simple_match.main.Derefer.after.mir                                   simple_match.main.SimplifyLocals-final.before.mir
simple_match.main.Derefer.before.mir                                  simple_match.main.StateTransform.after.mir
simple_match.main.DestinationPropagation.after.mir                    simple_match.main.StateTransform.before.mir
simple_match.main.DestinationPropagation.before.mir                   simple_match.main.UninhabitedEnumBranching.after.mir
simple_match.main.DestinationPropagation-dataflow.0.mir               simple_match.main.UninhabitedEnumBranching.before.mir
simple_match.main.ElaborateBoxDerefs.after.mir                        simple_match.main.UnreachablePropagation.after.mir
simple_match.main.ElaborateBoxDerefs.before.mir                       simple_match.main.UnreachablePropagation.before.mir
simple_match.main.ElaborateDrops.after.mir                            simple_match.match_bool.analysis.after.mir
simple_match.main.ElaborateDrops.before.mir                           simple_match.match_bool.built.after.mir
simple_match.main.EnumSizeOpt.after.mir                               simple_match.match_bool.nll.0.mir
simple_match.main.EnumSizeOpt.before.mir                              simple_match.match_bool.nll.0.regioncx.all.dot
simple_match.main.Inline.after.mir                                    simple_match.match_bool.nll.0.regioncx.scc.dot
simple_match.main.Inline.before.mir                                   simple_match.match_bool.PromoteTemps.after.mir
simple_match.main.InstCombine.after.mir                               simple_match.match_bool.PromoteTemps.before.mir
simple_match.main.InstCombine.before.mir                              simple_match.match_bool.renumber.0.mir
simple_match.main.LowerIntrinsics.after.mir                           simple_match.match_bool.SanityCheck.after.mir
simple_match.main.LowerIntrinsics.before.mir                          simple_match.match_bool.SanityCheck.before.mir
simple_match.main.LowerSliceLenCalls.after.mir                        simple_match.match_bool.SimplifyCfg-initial.after.mir
simple_match.main.LowerSliceLenCalls.before.mir                       simple_match.match_bool.SimplifyCfg-initial.before.mir
simple_match.main.MatchBranchSimplification.after.mir                 simple_match.match_bool.SimplifyCfg-promote-consts.after.mir
simple_match.main.MatchBranchSimplification.before.mir                simple_match.match_bool.SimplifyCfg-promote-consts.before.mir
simple_match.main.MultipleReturnTerminators.after.mir                 simple_match.out
simple_match.main.MultipleReturnTerminators.before.mir                stamp
simple_match.main.nll.0.mir

We already parse the comments in the file to see which files to compare:

let files = miropt_test_tools::files_for_miropt_test(
&self.testpaths.file,
self.config.get_pointer_width(),
);

hopefully it shouldn't be too tricky to work backwards from that to determine which pass to dump.

@jyn514 jyn514 added E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Mar 25, 2023
@mj10021
Copy link
Contributor

mj10021 commented Mar 30, 2023

Hello! Interested in contributing here, but might need some help.

I understand that an output file is being created for each MIR pass and that creates a huge amount of data which is problematic, but I am not sure what the desired output would be.

Do we want just one output file for each test instead of an output file for each MIR pass?

@jyn514
Copy link
Member

jyn514 commented Mar 31, 2023

Do we want just one output file for each test instead of an output file for each MIR pass?

In an ideal world, yes. Given that -Zdump-mir doesn't support that, I think "one output file for each pass under test" is going to be close enough - in practice I think most mir-opt tests only look at one pass anyway.

@mj10021
Copy link
Contributor

mj10021 commented Apr 3, 2023

Ok, thanks. I think I am missing something, is that not what is happening currently? For example, if I look at the output in /rust/build/x86_64-unknown-linux-gnu/test/mir-opt/issue_101973

Output

core.ops-function-FnOnce-call_once.AbortUnwindingCalls.after.mir
 core.ops-function-FnOnce-call_once.AbortUnwindingCalls.before.mir
 core.ops-function-FnOnce-call_once.AddCallGuards.after.mir
 core.ops-function-FnOnce-call_once.AddCallGuards.before.mir
 core.ops-function-FnOnce-call_once.AddMovesForPackedDrops.after.mir
 core.ops-function-FnOnce-call_once.AddMovesForPackedDrops.before.mir
 core.ops-function-FnOnce-call_once.Derefer.after.mir
 core.ops-function-FnOnce-call_once.Derefer.before.mir
 core.ops-function-FnOnce-call_once.RemoveNoopLandingPads.after.mir
 core.ops-function-FnOnce-call_once.RemoveNoopLandingPads.before.mir
 core.ops-function-FnOnce-call_once.SimplifyCfg-make_shim.after.mir
 core.ops-function-FnOnce-call_once.SimplifyCfg-make_shim.before.mir
 core.ops-function-FnOnce-call_once.runtime-optimized.after.mir
 core.ptr-drop_in_place.AbortUnwindingCalls.after.mir
 core.ptr-drop_in_place.AbortUnwindingCalls.before.mir
 core.ptr-drop_in_place.AddCallGuards.after.mir
 core.ptr-drop_in_place.AddCallGuards.before.mir
 core.ptr-drop_in_place.AddMovesForPackedDrops.after.mir
 core.ptr-drop_in_place.AddMovesForPackedDrops.before.mir
 core.ptr-drop_in_place.Derefer.after.mir
 core.ptr-drop_in_place.Derefer.before.mir
 core.ptr-drop_in_place.RemoveNoopLandingPads.after.mir
 core.ptr-drop_in_place.RemoveNoopLandingPads.before.mir
 core.ptr-drop_in_place.SimplifyCfg-make_shim.after.mir
 core.ptr-drop_in_place.SimplifyCfg-make_shim.before.mir
 core.ptr-drop_in_place.runtime-optimized.after.mir
 issue_101973
 issue_101973.err
 issue_101973.imm8.AbortUnwindingCalls.after.mir
 issue_101973.imm8.AbortUnwindingCalls.before.mir
 issue_101973.imm8.AddCallGuards.after.mir
 issue_101973.imm8.AddCallGuards.before.mir
 issue_101973.imm8.AddMovesForPackedDrops.after.mir
 issue_101973.imm8.AddMovesForPackedDrops.before.mir
 issue_101973.imm8.CheckAlignment.after.mir
 issue_101973.imm8.CheckAlignment.before.mir
 issue_101973.imm8.CleanupPostBorrowck.after.mir
 issue_101973.imm8.CleanupPostBorrowck.before.mir
 issue_101973.imm8.ConstGoto.after.mir
 issue_101973.imm8.ConstGoto.before.mir
 issue_101973.imm8.ConstProp.after.mir
 issue_101973.imm8.ConstProp.before.mir
 issue_101973.imm8.CopyProp.after.mir
 issue_101973.imm8.CopyProp.before.mir
 issue_101973.imm8.DataflowConstProp.after.mir
 issue_101973.imm8.DataflowConstProp.before.mir
 issue_101973.imm8.DeadStoreElimination.after.mir
 issue_101973.imm8.DeadStoreElimination.before.mir
 issue_101973.imm8.DeduplicateBlocks.after.mir
 issue_101973.imm8.DeduplicateBlocks.before.mir
 issue_101973.imm8.Derefer.after.mir
 issue_101973.imm8.Derefer.before.mir
 issue_101973.imm8.DestinationPropagation-dataflow.0.mir
 issue_101973.imm8.DestinationPropagation-dataflow.1.mir
 issue_101973.imm8.DestinationPropagation.after.mir
 issue_101973.imm8.DestinationPropagation.before.mir
 issue_101973.imm8.ElaborateBoxDerefs.after.mir
 issue_101973.imm8.ElaborateBoxDerefs.before.mir
 issue_101973.imm8.ElaborateDrops.after.mir
 issue_101973.imm8.ElaborateDrops.before.mir
 issue_101973.imm8.EnumSizeOpt.after.mir
 issue_101973.imm8.EnumSizeOpt.before.mir
 issue_101973.imm8.Inline.after.mir
 issue_101973.imm8.Inline.before.mir
 issue_101973.imm8.InstCombine.after.mir
 issue_101973.imm8.InstCombine.before.mir
 issue_101973.imm8.LowerIntrinsics.after.mir
 issue_101973.imm8.LowerIntrinsics.before.mir
 issue_101973.imm8.LowerSliceLenCalls.after.mir
 issue_101973.imm8.LowerSliceLenCalls.before.mir
 issue_101973.imm8.MatchBranchSimplification.after.mir
 issue_101973.imm8.MatchBranchSimplification.before.mir
 issue_101973.imm8.MultipleReturnTerminators.after.mir
 issue_101973.imm8.MultipleReturnTerminators.before.mir
 issue_101973.imm8.NormalizeArrayLen.after.mir
 issue_101973.imm8.NormalizeArrayLen.before.mir
 issue_101973.imm8.PreCodegen.after.mir
 issue_101973.imm8.PreCodegen.before.mir
 issue_101973.imm8.PromoteTemps.after.mir
 issue_101973.imm8.PromoteTemps.before.mir
 issue_101973.imm8.RemoveNoopLandingPads.after.mir
 issue_101973.imm8.RemoveNoopLandingPads.before.mir
 issue_101973.imm8.RemoveStorageMarkers.after.mir
 issue_101973.imm8.RemoveStorageMarkers.before.mir
 issue_101973.imm8.RemoveUnneededDrops.after.mir
 issue_101973.imm8.RemoveUnneededDrops.before.mir
 issue_101973.imm8.RemoveZsts.after.mir
 issue_101973.imm8.RemoveZsts.before.mir
 issue_101973.imm8.RenameReturnPlace.after.mir
 issue_101973.imm8.RenameReturnPlace.before.mir
 issue_101973.imm8.RevealAll.after.mir
 issue_101973.imm8.RevealAll.before.mir
 issue_101973.imm8.SanityCheck.after.mir
 issue_101973.imm8.SanityCheck.before.mir
 issue_101973.imm8.ScalarReplacementOfAggregates.after.mir
 issue_101973.imm8.ScalarReplacementOfAggregates.before.mir
 issue_101973.imm8.SeparateConstSwitch.after.mir
 issue_101973.imm8.SeparateConstSwitch.before.mir
 issue_101973.imm8.SimplifyCfg-after-uninhabited-enum-branching.after.mir
 issue_101973.imm8.SimplifyCfg-after-uninhabited-enum-branching.before.mir
 issue_101973.imm8.SimplifyCfg-early-opt.after.mir
 issue_101973.imm8.SimplifyCfg-early-opt.before.mir
 issue_101973.imm8.SimplifyCfg-elaborate-drops.after.mir
 issue_101973.imm8.SimplifyCfg-elaborate-drops.before.mir
 issue_101973.imm8.SimplifyCfg-final.after.mir
 issue_101973.imm8.SimplifyCfg-final.before.mir
 issue_101973.imm8.SimplifyCfg-initial.after.mir
 issue_101973.imm8.SimplifyCfg-initial.before.mir
 issue_101973.imm8.SimplifyCfg-promote-consts.after.mir
 issue_101973.imm8.SimplifyCfg-promote-consts.before.mir
 issue_101973.imm8.SimplifyComparisonIntegral.after.mir
 issue_101973.imm8.SimplifyComparisonIntegral.before.mir
 issue_101973.imm8.SimplifyConstCondition-after-const-prop.after.mir
 issue_101973.imm8.SimplifyConstCondition-after-const-prop.before.mir
 issue_101973.imm8.SimplifyConstCondition-final.after.mir
 issue_101973.imm8.SimplifyConstCondition-final.before.mir
 issue_101973.imm8.SimplifyLocals-before-const-prop.after.mir
 issue_101973.imm8.SimplifyLocals-before-const-prop.before.mir
 issue_101973.imm8.SimplifyLocals-final.after.mir
 issue_101973.imm8.SimplifyLocals-final.before.mir
 issue_101973.imm8.StateTransform.after.mir
 issue_101973.imm8.StateTransform.before.mir
 issue_101973.imm8.UninhabitedEnumBranching.after.mir
 issue_101973.imm8.UninhabitedEnumBranching.before.mir
 issue_101973.imm8.UnreachablePropagation.after.mir
 issue_101973.imm8.UnreachablePropagation.before.mir
 issue_101973.imm8.analysis-post-cleanup.after.mir
 issue_101973.imm8.analysis.after.mir
 issue_101973.imm8.built.after.mir
 issue_101973.imm8.nll.0.mir
 issue_101973.imm8.nll.0.regioncx.all.dot
 issue_101973.imm8.nll.0.regioncx.scc.dot
 issue_101973.imm8.renumber.0.mir
 issue_101973.imm8.runtime-optimized.after.mir
 issue_101973.imm8.runtime-post-cleanup.after.mir
 issue_101973.imm8.runtime.after.mir
 issue_101973.inner.AbortUnwindingCalls.after.mir
 issue_101973.inner.AbortUnwindingCalls.before.mir
 issue_101973.inner.AddCallGuards.after.mir
 issue_101973.inner.AddCallGuards.before.mir
 issue_101973.inner.AddMovesForPackedDrops.after.mir
 issue_101973.inner.AddMovesForPackedDrops.before.mir
 issue_101973.inner.CheckAlignment.after.mir
 issue_101973.inner.CheckAlignment.before.mir
 issue_101973.inner.CleanupPostBorrowck.after.mir
 issue_101973.inner.CleanupPostBorrowck.before.mir
 issue_101973.inner.ConstGoto.after.mir
 issue_101973.inner.ConstGoto.before.mir
 issue_101973.inner.ConstProp.after.mir
 issue_101973.inner.ConstProp.before.mir
 issue_101973.inner.CopyProp.after.mir
 issue_101973.inner.CopyProp.before.mir
 issue_101973.inner.DataflowConstProp.after.mir
 issue_101973.inner.DataflowConstProp.before.mir
 issue_101973.inner.DeadStoreElimination.after.mir
 issue_101973.inner.DeadStoreElimination.before.mir
 issue_101973.inner.DeduplicateBlocks.after.mir
 issue_101973.inner.DeduplicateBlocks.before.mir
 issue_101973.inner.Derefer.after.mir
 issue_101973.inner.Derefer.before.mir
 issue_101973.inner.DestinationPropagation-dataflow.0.mir
 issue_101973.inner.DestinationPropagation.after.mir
 issue_101973.inner.DestinationPropagation.before.mir
 issue_101973.inner.ElaborateBoxDerefs.after.mir
 issue_101973.inner.ElaborateBoxDerefs.before.mir
 issue_101973.inner.ElaborateDrops.after.mir
 issue_101973.inner.ElaborateDrops.before.mir
 issue_101973.inner.EnumSizeOpt.after.mir
 issue_101973.inner.EnumSizeOpt.before.mir
 issue_101973.inner.Inline.after.mir
 issue_101973.inner.Inline.before.mir
 issue_101973.inner.InstCombine.after.mir
 issue_101973.inner.InstCombine.before.mir
 issue_101973.inner.LowerIntrinsics.after.mir
 issue_101973.inner.LowerIntrinsics.before.mir
 issue_101973.inner.LowerSliceLenCalls.after.mir
 issue_101973.inner.LowerSliceLenCalls.before.mir
 issue_101973.inner.MatchBranchSimplification.after.mir
 issue_101973.inner.MatchBranchSimplification.before.mir
 issue_101973.inner.MultipleReturnTerminators.after.mir
 issue_101973.inner.MultipleReturnTerminators.before.mir
 issue_101973.inner.NormalizeArrayLen.after.mir
 issue_101973.inner.NormalizeArrayLen.before.mir
 issue_101973.inner.PreCodegen.after.mir
 issue_101973.inner.PreCodegen.before.mir
 issue_101973.inner.PromoteTemps.after.mir
 issue_101973.inner.PromoteTemps.before.mir
 issue_101973.inner.RemoveNoopLandingPads.after.mir
 issue_101973.inner.RemoveNoopLandingPads.before.mir
 issue_101973.inner.RemoveStorageMarkers.after.mir
 issue_101973.inner.RemoveStorageMarkers.before.mir
 issue_101973.inner.RemoveUnneededDrops.after.mir
 issue_101973.inner.RemoveUnneededDrops.before.mir
 issue_101973.inner.RemoveZsts.after.mir
 issue_101973.inner.RemoveZsts.before.mir
 issue_101973.inner.RenameReturnPlace.after.mir
 issue_101973.inner.RenameReturnPlace.before.mir
 issue_101973.inner.RevealAll.after.mir
 issue_101973.inner.RevealAll.before.mir
 issue_101973.inner.SanityCheck.after.mir
 issue_101973.inner.SanityCheck.before.mir
 issue_101973.inner.ScalarReplacementOfAggregates.after.mir
 issue_101973.inner.ScalarReplacementOfAggregates.before.mir
 issue_101973.inner.SeparateConstSwitch.after.mir
 issue_101973.inner.SeparateConstSwitch.before.mir
 issue_101973.inner.SimplifyCfg-after-uninhabited-enum-branching.after.mir
 issue_101973.inner.SimplifyCfg-after-uninhabited-enum-branching.before.mir
 issue_101973.inner.SimplifyCfg-early-opt.after.mir
 issue_101973.inner.SimplifyCfg-early-opt.before.mir
 issue_101973.inner.SimplifyCfg-elaborate-drops.after.mir
 issue_101973.inner.SimplifyCfg-elaborate-drops.before.mir
 issue_101973.inner.SimplifyCfg-final.after.mir
 issue_101973.inner.SimplifyCfg-final.before.mir
 issue_101973.inner.SimplifyCfg-initial.after.mir
 issue_101973.inner.SimplifyCfg-initial.before.mir
 issue_101973.inner.SimplifyCfg-promote-consts.after.mir
 issue_101973.inner.SimplifyCfg-promote-consts.before.mir
 issue_101973.inner.SimplifyComparisonIntegral.after.mir
 issue_101973.inner.SimplifyComparisonIntegral.before.mir
 issue_101973.inner.SimplifyConstCondition-after-const-prop.after.mir
 issue_101973.inner.SimplifyConstCondition-after-const-prop.before.mir
 issue_101973.inner.SimplifyConstCondition-final.after.mir
 issue_101973.inner.SimplifyConstCondition-final.before.mir
 issue_101973.inner.SimplifyLocals-before-const-prop.after.mir
 issue_101973.inner.SimplifyLocals-before-const-prop.before.mir
 issue_101973.inner.SimplifyLocals-final.after.mir
 issue_101973.inner.SimplifyLocals-final.before.mir
 issue_101973.inner.StateTransform.after.mir
 issue_101973.inner.StateTransform.before.mir
 issue_101973.inner.UninhabitedEnumBranching.after.mir
 issue_101973.inner.UninhabitedEnumBranching.before.mir
 issue_101973.inner.UnreachablePropagation.after.mir
 issue_101973.inner.UnreachablePropagation.before.mir
 issue_101973.inner.analysis-post-cleanup.after.mir
 issue_101973.inner.analysis.after.mir
 issue_101973.inner.built.after.mir
 issue_101973.inner.nll.0.mir
 issue_101973.inner.nll.0.regioncx.all.dot
 issue_101973.inner.nll.0.regioncx.scc.dot
 issue_101973.inner.renumber.0.mir
 issue_101973.inner.runtime-optimized.after.mir
 issue_101973.inner.runtime-post-cleanup.after.mir
 issue_101973.inner.runtime.after.mir
'issue_101973.main-promoted[0].AbortUnwindingCalls.after.mir'
'issue_101973.main-promoted[0].AbortUnwindingCalls.before.mir'
'issue_101973.main-promoted[0].AddCallGuards.after.mir'
'issue_101973.main-promoted[0].AddCallGuards.before.mir'
'issue_101973.main-promoted[0].AddMovesForPackedDrops.after.mir'
'issue_101973.main-promoted[0].AddMovesForPackedDrops.before.mir'
'issue_101973.main-promoted[0].CleanupPostBorrowck.after.mir'
'issue_101973.main-promoted[0].CleanupPostBorrowck.before.mir'
'issue_101973.main-promoted[0].Derefer.after.mir'
'issue_101973.main-promoted[0].Derefer.before.mir'
'issue_101973.main-promoted[0].ElaborateBoxDerefs.after.mir'
'issue_101973.main-promoted[0].ElaborateBoxDerefs.before.mir'
'issue_101973.main-promoted[0].ElaborateDrops.after.mir'
'issue_101973.main-promoted[0].ElaborateDrops.before.mir'
'issue_101973.main-promoted[0].LowerIntrinsics.after.mir'
'issue_101973.main-promoted[0].LowerIntrinsics.before.mir'
'issue_101973.main-promoted[0].RemoveNoopLandingPads.after.mir'
'issue_101973.main-promoted[0].RemoveNoopLandingPads.before.mir'
'issue_101973.main-promoted[0].SimplifyCfg-early-opt.after.mir'
'issue_101973.main-promoted[0].SimplifyCfg-early-opt.before.mir'
'issue_101973.main-promoted[0].SimplifyCfg-elaborate-drops.after.mir'
'issue_101973.main-promoted[0].SimplifyCfg-elaborate-drops.before.mir'
'issue_101973.main-promoted[0].StateTransform.after.mir'
'issue_101973.main-promoted[0].StateTransform.before.mir'
'issue_101973.main-promoted[0].analysis-post-cleanup.after.mir'
'issue_101973.main-promoted[0].runtime-post-cleanup.after.mir'
'issue_101973.main-promoted[0].runtime.after.mir'
 issue_101973.main.AbortUnwindingCalls.after.mir
 issue_101973.main.AbortUnwindingCalls.before.mir
 issue_101973.main.AddCallGuards.after.mir
 issue_101973.main.AddCallGuards.before.mir
 issue_101973.main.AddMovesForPackedDrops.after.mir
 issue_101973.main.AddMovesForPackedDrops.before.mir
 issue_101973.main.CheckAlignment.after.mir
 issue_101973.main.CheckAlignment.before.mir
 issue_101973.main.CleanupPostBorrowck.after.mir
 issue_101973.main.CleanupPostBorrowck.before.mir
 issue_101973.main.ConstGoto.after.mir
 issue_101973.main.ConstGoto.before.mir
 issue_101973.main.ConstProp.after.mir
 issue_101973.main.ConstProp.before.mir
 issue_101973.main.CopyProp.after.mir
 issue_101973.main.CopyProp.before.mir
 issue_101973.main.DataflowConstProp.after.mir
 issue_101973.main.DataflowConstProp.before.mir
 issue_101973.main.DeadStoreElimination.after.mir
 issue_101973.main.DeadStoreElimination.before.mir
 issue_101973.main.DeduplicateBlocks.after.mir
 issue_101973.main.DeduplicateBlocks.before.mir
 issue_101973.main.Derefer.after.mir
 issue_101973.main.Derefer.before.mir
 issue_101973.main.DestinationPropagation-dataflow.0.mir
 issue_101973.main.DestinationPropagation-dataflow.1.mir
 issue_101973.main.DestinationPropagation.after.mir
 issue_101973.main.DestinationPropagation.before.mir
 issue_101973.main.ElaborateBoxDerefs.after.mir
 issue_101973.main.ElaborateBoxDerefs.before.mir
 issue_101973.main.ElaborateDrops.after.mir
 issue_101973.main.ElaborateDrops.before.mir
 issue_101973.main.EnumSizeOpt.after.mir
 issue_101973.main.EnumSizeOpt.before.mir
 issue_101973.main.Inline.after.mir
 issue_101973.main.Inline.before.mir
 issue_101973.main.InstCombine.after.mir
 issue_101973.main.InstCombine.before.mir
 issue_101973.main.LowerIntrinsics.after.mir
 issue_101973.main.LowerIntrinsics.before.mir
 issue_101973.main.LowerSliceLenCalls.after.mir
 issue_101973.main.LowerSliceLenCalls.before.mir
 issue_101973.main.MatchBranchSimplification.after.mir
 issue_101973.main.MatchBranchSimplification.before.mir
 issue_101973.main.MultipleReturnTerminators.after.mir
 issue_101973.main.MultipleReturnTerminators.before.mir
 issue_101973.main.NormalizeArrayLen.after.mir
 issue_101973.main.NormalizeArrayLen.before.mir
 issue_101973.main.PreCodegen.after.mir
 issue_101973.main.PreCodegen.before.mir
 issue_101973.main.PromoteTemps.after.mir
 issue_101973.main.PromoteTemps.before.mir
 issue_101973.main.RemoveNoopLandingPads.after.mir
 issue_101973.main.RemoveNoopLandingPads.before.mir
 issue_101973.main.RemoveStorageMarkers.after.mir
 issue_101973.main.RemoveStorageMarkers.before.mir
 issue_101973.main.RemoveUnneededDrops.after.mir
 issue_101973.main.RemoveUnneededDrops.before.mir
 issue_101973.main.RemoveZsts.after.mir
 issue_101973.main.RemoveZsts.before.mir
 issue_101973.main.RenameReturnPlace.after.mir
 issue_101973.main.RenameReturnPlace.before.mir
 issue_101973.main.RevealAll.after.mir
 issue_101973.main.RevealAll.before.mir
 issue_101973.main.SanityCheck.after.mir
 issue_101973.main.SanityCheck.before.mir
 issue_101973.main.ScalarReplacementOfAggregates.after.mir
 issue_101973.main.ScalarReplacementOfAggregates.before.mir
 issue_101973.main.SeparateConstSwitch.after.mir
 issue_101973.main.SeparateConstSwitch.before.mir
 issue_101973.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
 issue_101973.main.SimplifyCfg-after-uninhabited-enum-branching.before.mir
 issue_101973.main.SimplifyCfg-early-opt.after.mir
 issue_101973.main.SimplifyCfg-early-opt.before.mir
 issue_101973.main.SimplifyCfg-elaborate-drops.after.mir
 issue_101973.main.SimplifyCfg-elaborate-drops.before.mir
 issue_101973.main.SimplifyCfg-final.after.mir
 issue_101973.main.SimplifyCfg-final.before.mir
 issue_101973.main.SimplifyCfg-initial.after.mir
 issue_101973.main.SimplifyCfg-initial.before.mir
 issue_101973.main.SimplifyCfg-promote-consts.after.mir
 issue_101973.main.SimplifyCfg-promote-consts.before.mir
 issue_101973.main.SimplifyComparisonIntegral.after.mir
 issue_101973.main.SimplifyComparisonIntegral.before.mir
 issue_101973.main.SimplifyConstCondition-after-const-prop.after.mir
 issue_101973.main.SimplifyConstCondition-after-const-prop.before.mir
 issue_101973.main.SimplifyConstCondition-final.after.mir
 issue_101973.main.SimplifyConstCondition-final.before.mir
 issue_101973.main.SimplifyLocals-before-const-prop.after.mir
 issue_101973.main.SimplifyLocals-before-const-prop.before.mir
 issue_101973.main.SimplifyLocals-final.after.mir
 issue_101973.main.SimplifyLocals-final.before.mir
 issue_101973.main.StateTransform.after.mir
 issue_101973.main.StateTransform.before.mir
 issue_101973.main.UninhabitedEnumBranching.after.mir
 issue_101973.main.UninhabitedEnumBranching.before.mir
 issue_101973.main.UnreachablePropagation.after.mir
 issue_101973.main.UnreachablePropagation.before.mir
 issue_101973.main.analysis-post-cleanup.after.mir
 issue_101973.main.analysis.after.mir
 issue_101973.main.built.after.mir
 issue_101973.main.nll.0.mir
 issue_101973.main.nll.0.regioncx.all.dot
 issue_101973.main.nll.0.regioncx.scc.dot
 issue_101973.main.renumber.0.mir
 issue_101973.main.runtime-optimized.after.mir
 issue_101973.main.runtime-post-cleanup.after.mir
 issue_101973.main.runtime.after.mir
 issue_101973.out
 stamp 

Is each one of these not an output from an MIR pass? For example, I am assuming issue_101973.main.runtime-optimized.after.mir and issue_101973.main.runtime-post-cleanup.after.mir are the before and after of some MIR optimization, wouldn't "-Zdump-mir=all" require their output?

@jyn514
Copy link
Member

jyn514 commented Apr 3, 2023

Yes, -Zdump-mir=all is working correctly. I'm saying we shouldn't be using -Zdump-mir=all in the first place - we should only emit the passes we are actively verifying for that test, not all passes that happen to change the MIR.

@jyn514
Copy link
Member

jyn514 commented Apr 3, 2023

For example, the only check in simple-match.rs is

// EMIT_MIR simple_match.match_bool.built.after.mir
so we should only pass -Zdump-mir=built.

@mj10021
Copy link
Contributor

mj10021 commented Apr 4, 2023

Got it, thanks for clarifying, for some reason I thought you were saying -Zdump-mir=all was mandatory, must have misread something.

Anyway I'll give this one a go @rustbot claim

@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue May 5, 2023
Reduce MIR dump file count for MIR-opt tests

As referenced in issue rust-lang#109502 , mir-opt tests previously used the -Zdump-mir=all flag, which generates very large output.  This PR only dumps the passes under test, greatly reducing dump output.
@kusabana
Copy link
Contributor

Is there any reason this issue is still open? @mj10021's PR containing the changes discussed was merged, and output has been reduced significantly.

@scottmcm
Copy link
Member Author

scottmcm commented Aug 27, 2023

I remember this being much better after those changes, so I'll just close it.

Yeah, 6× fewer files and 4× smaller size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-mir-opt Area: MIR optimizations A-testsuite Area: The testsuite used to check the correctness of rustc E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants