public class PeepholeOptimizer extends Object
Constructor and Description |
---|
PeepholeOptimizer() |
Modifier and Type | Method and Description |
---|---|
void |
process(ILOCProgram program) |
void |
removeChainedJump(ILOCFunction func)
Replaces instructions of the form:
jmp lX
[...]
lX: jmp lY
with
jmp lY
[...]
lX: jmp lY
|
void |
removeIdentityAddAndMult(ILOCFunction func)
Replaces instructions of the form:
addI rX, 0 => rY
with
i2i rX => rY and
Replaces instructions of the form:
multI rX, 1 => rY
with
i2i rX => rY
Removes instructions of the form: addI rX, 0 => rX
Removes instructions of the form: multI rX, 1 => rX
|
void |
removeUselessCopies(ILOCFunction func)
Removes instructions of the form: i2i rX -> rX
|
void |
replaceOneLineJumps(ILOCFunction func)
Removes jump in code of the form:
jmp lX
lX: [...]
|
void |
storeLoadOptimize(ILOCFunction func)
(CASE 1) Replaces code of the form:
storeAI rX -> bp + offset
load bp + offset -> rY
with
storeAI rX -> bp + offset
i2i rX -> rY
(CASE 2) Replaces code of the form:
storeAI rX => BP+offset
load BP+offset => rX
with
storeAI rX => BP+offset
|
public void process(ILOCProgram program)
public void storeLoadOptimize(ILOCFunction func)
func
- - ILOCFunction to be optimizedpublic void replaceOneLineJumps(ILOCFunction func)
func
- - ILOCFunction to be optimizedpublic void removeUselessCopies(ILOCFunction func)
func
- - ILOCFunction to be optimizedpublic void removeIdentityAddAndMult(ILOCFunction func)
func
- - ILOCFunction to be optimizedpublic void removeChainedJump(ILOCFunction func)
func
- - ILOCFunction to be optimizedCopyright © 2019. All rights reserved.