This patch removes unnecessary zero copies in BBs that are targets of b.eq/b.ne and we know the result of the compare instruction is zero. For example,
BB#0: subs w0, w1, w2 str w0, [x1] b.ne .LBB0_2 BB#1: mov w0, wzr ; <-- redundant str w0, [x2] .LBB0_2
See test cases for additional examples.
Chad
This comment needs some updating as well: not just zero copies are removed and not just cbz/cbnz branches are handled.