The previous implementation was iterating on the instructions in order.
This caused problems when we had two instructions, A and B, both tagged
IsRef, and B was using A and B had 2 or more uses.
In this case the pass was looking at A before looking at B, so A was not
duplicated because it only had one use (B).
Then B was analyzed and it had 2 uses so it was duplicated, causing the
number of uses of A to increase accordingly.
This commit fixes the problem iterating on the BasicBlocks in post
order, and on the instruction list in reverse order.
It also fixes MarkAssignments.cpp not to erroneously mark instructions
that are marked IsRef.