Do not incorrectly set the inverted flag.
authorHongbin Zheng <etherzhhb@gmail.com>
Fri, 28 Nov 2014 03:26:06 +0000 (03:26 +0000)
committerHongbin Zheng <etherzhhb@gmail.com>
Fri, 28 Nov 2014 03:26:06 +0000 (03:26 +0000)
commitc5447f4c3b786f0f904fd47721902560682f12f2
treeba44787254250f810b5f6e36bd83c547f8cd9a98
parent724f14e75c50c6839408509b2fede5464fa9111e
Do not incorrectly set the inverted flag.

In TempScopInfo::buildCondition we extract the conditions to guard the
BB *in addition of* loop bounds. This means we should only consider the
conditions in the paths (in CFG) that do not contain cycles (loops).

At the same time, we set the invert flag if the FalseBB of the current
branch dominates our target BB to indicate that we reach the target BB
with an inverted condition from the current branch.

In this case, the path from the FalseBB contains a cycle if the FalseBB
is the target of a backedge. The conditions implied by such a path should
not be consider. We can identify such a case by checking if the TrueBB
also dominates our target BB, which means we can also reach our target
BB from the TrueBB, without going through the backedge.

llvm-svn: 222907
polly/lib/Analysis/TempScopInfo.cpp
polly/test/TempScop/nested-loops.ll [new file with mode: 0644]