pass: add PruneSelfMoves cleanup pass (#80)

In some cases natural use of abstraction in avo programs can lead to redundant move instructions, specifically self-moves such as MOVQ AX, AX. This does not produce incorrect code but it is incorrect and inelegant.

This diff introduces a PruneSelfMoves pass that removes such unnecessary instructions.

Closes #76
This commit is contained in:
Michael McLoughlin
2019-04-14 14:26:28 -07:00
committed by GitHub
parent 5d3176b111
commit 57c23b967e
10 changed files with 196 additions and 25 deletions

View File

@@ -18,6 +18,7 @@ var Compile = Concat(
FunctionPass(BindRegisters),
FunctionPass(VerifyAllocation),
Func(IncludeTextFlagHeader),
FunctionPass(PruneSelfMoves),
)
// Interface for a processing pass.