[Detect] Consider nested loop profitable if entry block is not in loop
commit4af5898de2502c50f5ed66a988e768aba10a88cf
authorTobias Grosser <tobias@grosser.es>
Sun, 27 Aug 2017 21:39:25 +0000 (27 21:39 +0000)
committerTobias Grosser <tobias@grosser.es>
Sun, 27 Aug 2017 21:39:25 +0000 (27 21:39 +0000)
tree3384d992b1aa8fd00df138662599dd40e99c87c4
parenteade4df9042bc83df1b9d0c8bb08d7a2d60d3e94
[Detect] Consider nested loop profitable if entry block is not in loop

In cases where the entry block of a scop was not contained in a loop that was
part of the scop region and at the same time there was a loop surrounding the
scop, we missed to count the loops in the scop and consequently did not consider
the scop profitable. We correct this by only moving to the loop parent, in case
the current loop is loop contained in the scop.

This increases the number of loops in COSMO which we assume to be profitable
from 3974 to 4981.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@311863 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScopDetection.cpp
test/ScopDetect/profitability-two-nested-loops.ll [new file with mode: 0644]