Accesses for exit node phis will be handled separately by buildPHIAccesses if there is more than one exiting edge, buildScalarDependences does not need to create additional SCALAR accesses.
This is a corrected version of r250517, which was reverted in r250607.
is A single exiting block
What are 'node PHIs'? Do you mean PHI nodes?
The last sentence is incomplete. It does not contain a verb in the main phrase.
It also took me a little while to understand this condition. I have the feeling moving this check into its own condition and elaborating a little more on why we bail out may make this more understandable. Does the following explain correctly what is going on? If it does, maybe you want to add some of this information to your final commit.
// Check for PHI nodes in the region exit and skip them, if they will be modeled // as PHI nodes. // // PHI nodes in the region exit that have more than two incoming edges need to // be modeled as PHI-Nodes to correctly model the fact that depending on the // control flow a different value will be assigned to the PHI node. In case this // is the case, there is no need to create an additional normal scalar dependence. // Hence bail out, before we register an "out-of-region" use for this definition. if (isa<PHINode>(UI) && UI->getParent() == R->getExit() && !R->getExitingBlock()) continue; // Check whether or not the use is in the SCoP. if (!R->contains(UseParent)) { AnyCrossStmtUse = true; continue; }