You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduces the creaetion of reverse dominance frontier (RDF) to support
dead code elimination (DCE). Method for implementing RDF is similar to
that of dominance frontier (DF). The key difference is that RDF is
computed on the reverse CFG. In other words, operations were performed
on "prev[]" which in the basic block structure, now switched to operate
on "next", "then_" and "else_".
In the "dce_insn" function, mark useful instructions during the initial
analysis of the current basic block. Continue identifying useful
instructions by tracing back from the last assigned instruction of the
both operands of the current "insn". In the "dce_sweep" function remove
the useless instruction from the current "insn_list". If a branch
instruction is encountered, remove it and reconnect the current basic
block to its reverse immediate dominator.
Before implementing DCE, compiling "src/main.c" resulted in an
executable with 51,357 instructions for ARMv7-A. After DCE, the
executable was 51,330 instructions, reducing the total by 27
instructions.
0 commit comments