Local optimization fixes for diverences found by self verification.

1) Only optimize each block once. Strictly speaking this is not a
correctness issue however it triggers the subsequent problem.

2) Ignore dead instructions.

    1: ldr     r2, [r5, #8]
    2: ldr     r3, [r5, #8](nop)
    3: str     r3, [r5, #4]
    4: movs    r3, r2

When using instruction 1 to initiate redundant ld/st eliminations, if
instruction 2 (which is already dead) is not ignored, it will be turned
into a "mov r3, r2" and that will clobber r3 used by the str.

Change-Id: I6b9a88d3688889d917b90f4b8f55278df1701c6a
2 files changed