summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopDetection.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2017-09-24 09:25:30 +0000
committerTobias Grosser <tobias@grosser.es>2017-09-24 09:25:30 +0000
commitee457594c20e34265303080fb5b94189e3a8d719 (patch)
tree9432947adb7d303b3a4bce5454fef3d3502970a3 /polly/lib/Analysis/ScopDetection.cpp
parentf894ce35d01274138489644110d60fca7e715207 (diff)
downloadbcm5719-llvm-ee457594c20e34265303080fb5b94189e3a8d719.tar.gz
bcm5719-llvm-ee457594c20e34265303080fb5b94189e3a8d719.zip
[ScopDetect/Info] Look through PHIs that follow an error block
In case a PHI node follows an error block we can assume that the incoming value can only come from the node that is not an error block. As a result, conditions that seemed non-affine before are now in fact affine. This is a recommit of r312663 after fixing test/Isl/CodeGen/phi_after_error_block_outside_of_scop.ll llvm-svn: 314075
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 56e0259ffce..fb951c5055e 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -607,6 +607,9 @@ bool ScopDetection::isValidBranch(BasicBlock &BB, BranchInst *BI,
const SCEV *LHS = SE.getSCEVAtScope(ICmp->getOperand(0), L);
const SCEV *RHS = SE.getSCEVAtScope(ICmp->getOperand(1), L);
+ LHS = tryForwardThroughPHI(LHS, Context.CurRegion, SE, LI, DT);
+ RHS = tryForwardThroughPHI(RHS, Context.CurRegion, SE, LI, DT);
+
// If unsigned operations are not allowed try to approximate the region.
if (ICmp->isUnsigned() && !PollyAllowUnsignedOperations)
return !IsLoopBranch && AllowNonAffineSubRegions &&
OpenPOWER on IntegriCloud