scop detection: run isValidCFG as early as possible

to discard regions with invalid CFG before going through the contents of the
basic blocks

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@183797 91177308-0d34-0410-b5e6-96231b3b80d8
scop detection: run isValidLoop as early as possible

to discard regions with invalid loops before going through the contents of the
basic blocks

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@183798 91177308-0d34-0410-b5e6-96231b3b80d8
scop detection: remove an iteration over all uses

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@183799 91177308-0d34-0410-b5e6-96231b3b80d8
ScopDetect: check region entering edges are valid.

When a region header is part of a loop, then all entering edges of this region
should not come from the loop but outside the region. Otherwise, the loop may be
only partially part of the region, which would cause troubles in handling
induction variables.

Currently, we can only model induction variables that are either fully part of
the scop (loop induction variable) or induction variables that are scop-
invariant (parameter). A loop that is only partially part of the
scop causes troubles, as there is no good way to handle the induction
variable in the independent blocks pass.

Contributed-by:    Star Tan <tanmx_star@yeah.net>

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@183800 91177308-0d34-0410-b5e6-96231b3b80d8