Situation
A PIC function's return value is stored into a local pseudo-register. When it is used as another PIC function's parameter, it is stored into an input pseudo-register again.
For example, the following expression:
(bar (foo))
is compiled into:
CALL _FOO
MOVWF L0
MOVF L0,W
MOVWF I0
CALL _BAR
Problem
There are reducible move instructions.
Solution
When a PIC function's return value is just used as another PIC function's parameter, make it stored into an input pseudo-register directly.
Situation A PIC function's return value is stored into a local pseudo-register. When it is used as another PIC function's parameter, it is stored into an input pseudo-register again.
For example, the following expression:
is compiled into:
Problem There are reducible move instructions.
Solution When a PIC function's return value is just used as another PIC function's parameter, make it stored into an input pseudo-register directly.