IF Statement Optimization

Special cases of IF statements are common; these can be compiled as shown below, where bra c represents a branch on condition and bra -c represents a branch on the opposite of a condition.


(if c (goto l))            bra c   l

(if c (progn) (goto l))    bra -c  l

(if c p1 (goto l))         bra -c  l
                           p1

(if c (goto l) p2)         bra c   l
                           p2

(if c p1)                  bra -c  L1
                           p1
                       L1:

(if c (progn) p2)          bra c   L1
                           p2
                       L1:

Contents    Page-10    Prev    Next    Page+10    Index