Refactored llvm::removeUnreachableBlocks, including the
markAliveBlocks helper. The part in markAliveBlocks that
examines instructions inside a basic block, and that can
change instructions to unreachable, was factored out to
a new rewriteUnreachableInstrs helper.
Also added a new boolean parameter to removeUnreachableBlocks
to be able to skip the rewriteUnreachableInstrs part.