ok damn it nearly works

This commit is contained in:
SpookyDervish
2025-09-12 06:28:45 +10:00
parent 2ce71e7abb
commit 865a31827a
6 changed files with 107 additions and 27 deletions

View File

@@ -140,5 +140,26 @@ class X86_64Optimizer(Optimizer):
Instruction("mov", ["y", "x"])
],
replace=[]
),
PeepholeRule(
match=[
Instruction("mov", ["x", "y"]),
Instruction("add", ["z", "x"])
],
replace=[
Instruction("add", ["z", "y"])
]
),
PeepholeRule(
match=[
Instruction("add", ["x", "0"])
],
replace=[]
),
PeepholeRule(
match=[Instruction("mov", ["x", "x"])],
replace=[]
)
]