[LOOPGUARD] Disable loop with multiple loop exiting blocks.
authorWhitney Tsang <whitney.uwaterloo@gmail.com>
Thu, 26 Sep 2019 20:20:42 +0000 (20:20 +0000)
committerWhitney Tsang <whitney.uwaterloo@gmail.com>
Thu, 26 Sep 2019 20:20:42 +0000 (20:20 +0000)
commit49f2855c39891aac8141c829b6b9069e0355a6f8
tree877190fdcaf81777a25d45bcabb5852efca2cdb0
parentc58a5d49af35f909dd54dd49cf94b2c569e81379
[LOOPGUARD] Disable loop with multiple loop exiting blocks.
Summary: As discussed in the loop group meeting. With the current
definition of loop guard, we should not allow multiple loop exiting
blocks. For loops that has multiple loop exiting blocks, we can simply
unable to find the loop guard.
When getUniqueExitBlock() obtains a vector size not equals to one, that
means there is either no exit blocks or there exists more than one
unique block the loop exit to.
If we don't disallow loop with multiple loop exit blocks, then with our
current implementation, there can exist exit blocks don't post dominated
by the non pre-header successor of the guard block.
Reviewer: reames, Meinersbur, kbarton, etiotto, bmahjour
Reviewed By: Meinersbur, kbarton
Subscribers: fhahn, hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D66529

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373011 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/LoopInfo.cpp
unittests/Analysis/LoopInfoTest.cpp