This is an archive of the discontinued LLVM Phabricator instance.

[LegacyPassManager] Check Changed status returned by MachineFunctionPasses
Changes PlannedPublic

Authored by foad on Feb 18 2022, 5:48 AM.

Details

Summary

With EXPENSIVE_CHECKS, hash MachineFunctions before and
after running each MachineFunctionPass to detect passes
which modify the MachineFunction but return Changed = false.

FIXME: This causes thousands of failures in the lit test
suite.

Diff Detail

Event Timeline

foad created this revision.Feb 18 2022, 5:48 AM
foad requested review of this revision.Feb 18 2022, 5:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2022, 5:48 AM

LGTM, when I had to do that move for regular passes, I started by fixing each individual pass before I landed the actual check.

foad added a comment.Feb 25 2022, 1:20 AM

LGTM, when I had to do that move for regular passes, I started by fixing each individual pass before I landed the actual check.

Yes of course, I will need to fix the individual passes. This patch is just here for reference and so other people can try it out if they want.

foad added a comment.Feb 25 2022, 7:53 AM

Just for interest, here is the current list of passes that trigger this failure, and how many times each one triggers in a check-llvm run:

1 AArch64 MI Peephole Optimization pass
1 AMDGPUPostLegalizerCombiner
1 AMDGPUPreLegalizerCombiner
1 ARM MVE TailPred and VPT Optimisation Pass
1 AVR memory operation relaxation pass
1 Hexagon generate predicate operations
1 Live Interval Analysis
1 Machine Loop Invariant Code Motion
1 Modulo Schedule test pass
1 WebAssembly Fix br_table Defaults
2 AArch64PostLegalizerCombiner
2 AArch64PostLegalizerLowering
2 R600 Vector Registers Merge Pass
3 Analyze Machine Code For Garbage Collection
3 ARM load / store optimization pass
4 AArch64PreLegalizerCombiner
4 If Converter
4 SI Fold Operands
6 R600 Control Flow Finalizer Pass
7 Hexagon Hardware Loops
7 Post RA hazard recognizer
7 SI optimize exec mask operations
9 X86 Avoid Store Forwarding Blocks
10 PowerPC Pre-Emit Peephole
13 InstructionSelect
15 Debug Variable Analysis
16 PowerPC MI Peephole Optimization
18 ARM Execution Domain Fix
18 Hexagon RDF optimizations
20 Machine Common Subexpression Elimination
21 Legalizer
21 Verify generated machine code
22 PostRA Machine Sink
27 Finalize ISel and expand pseudo-instructions
28 WebAssembly Prepare For LiveIntervals
31 BreakFalseDeps
32 Post-RA pseudo instruction expansion pass
48 Early Machine Loop Invariant Code Motion
52 Live Variable Analysis
53 Live Range Shrink
57 R600 Emit Clause Markers Pass
69 Modulo Software Pipelining
87 SI Memory Legalizer
156 RegBankSelect
264 ARM constant island placement and branch shortening pass
408 Peephole Optimizations
587 Analysis containing CSE Info
587 SI Shrink Instructions
644 MIPS DAG->DAG Pattern Instruction Selection
690 Two-Address instruction pass
871 X86 Execution Dependency Fix
985 Control Flow Optimizer