summaryrefslogtreecommitdiffstats
path: root/polly/lib
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib')
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 396a11e13ae..c889a098dc8 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -3342,6 +3342,27 @@ bool ScopInfo::buildScalarDependences(Instruction *Inst, Region *R,
if (UseParent == ParentBB && !isa<PHINode>(UI))
continue;
+ // Uses by PHI nodes in the entry node count as external uses in case the
+ // use is through an incoming block that is itself not contained in the
+ // region.
+ if (R->getEntry() == UseParent) {
+ if (auto *PHI = dyn_cast<PHINode>(UI)) {
+ bool ExternalUse = false;
+ for (unsigned i = 0; i < PHI->getNumIncomingValues(); i++) {
+ if (PHI->getIncomingValue(i) == Inst &&
+ !R->contains(PHI->getIncomingBlock(i))) {
+ ExternalUse = true;
+ break;
+ }
+ }
+
+ if (ExternalUse) {
+ AnyCrossStmtUse = true;
+ continue;
+ }
+ }
+ }
+
// Do not build scalar dependences inside a non-affine subregion.
if (NonAffineSubRegion && NonAffineSubRegion->contains(UseParent))
continue;
@@ -3365,27 +3386,6 @@ bool ScopInfo::buildScalarDependences(Instruction *Inst, Region *R,
continue;
}
- // Uses by PHI nodes in the entry node count as external uses in case the
- // use is through an incoming block that is itself not contained in the
- // region.
- if (R->getEntry() == UseParent) {
- if (auto *PHI = dyn_cast<PHINode>(UI)) {
- bool ExternalUse = false;
- for (unsigned i = 0; i < PHI->getNumIncomingValues(); i++) {
- if (PHI->getIncomingValue(i) == Inst &&
- !R->contains(PHI->getIncomingBlock(i))) {
- ExternalUse = true;
- break;
- }
- }
-
- if (ExternalUse) {
- AnyCrossStmtUse = true;
- continue;
- }
- }
- }
-
// If the instruction can be synthesized and the user is in the region
// we do not need to add scalar dependences.
if (canSynthesizeInst)
OpenPOWER on IntegriCloud