[MBP] Factor out function hasViableTopFallthrough and enhancement

This patch factor out the function hasViableTopFallthrough from rotateLoop. It is also enhanced. Original code checks only if there is a block can be placed before current loop top. This patch also checks if the loop top is the most possible successor of its predecessor. The attached test case shows its effect.

Differential Revision: https://reviews.llvm.org/D58393



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354682 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed