pic icon indicating copy to clipboard operation
pic copied to clipboard

Reducible move instructions on PROGN PIC macro

Open takagi opened this issue 9 years ago • 0 comments

Situation

A predefined PIC macro progn is expanded into a series of let bindings. The return values of its containing expressions are bound to temporal variables, which are never referenced.

For example, the following expression:

(progn
  (foo-routine)
  (bar-routine))

is expanded into:

(let ((tmp (foo-routine)))
  (bar-routine))

then, is compiled into:

CALL     _FOO_ROUTINE
MOVWF    L0
CALL     _BAR_ROUTINE

Problem The MOVWF instruction is reducible.

Solution Reducing the useless MOVWF instruction.

CALL     _FOO_ROUTINE
CALL     _BAR_ROUTINE

takagi avatar Feb 27 '15 20:02 takagi