The old invalidation lattice was incorrect because changes to control flow could cause changes to the
call graph, so we've decided to change the way passes invalidate analysis. In the new scheme, the lattice
is replaced with a list of traits that passes preserve or invalidate. The current traits are Calls and Branches.
Now, passes report which traits they preserve, which is the opposite of the previous implementation where
passes needed to report what they invalidate.
Node: I tried to limit the changes in this commit to mechanical changes to ease the review. I will cleanup some
of the code in a following commit.
Swift SVN r26449
Run a loopSimplify helper before loopRotate to put the loop in
canonical form. This now handles the case of multiple-backedges, which
is very common for unsimplified loops.
TODO: We still don't split nested loops that have a shared
header. LLVM has logic for this, we should probably do the same.
Swift SVN r24008
Volatile method instructions are not invariant. open_existential instructions
can't be cloned using the SILInstruction clone() api follow up instructions need
to use the same cloner so that the opened existential archetype uid can be
shared.
Swift SVN r22754
This follows the model of dominance info and allows me to create reachability
methods on SILBasicBlock without creating dependencies from swiftSIL to
swiftSILAnalysis.
Swift SVN r21866
Use it in loop rotation.
The pattern to update analysis information is:
// The AnalysisInfo was preserved for this function.
if (Changed) {
// Preserve the analyis for this function by decoupling it from the analysis
// cache.
auto PreservedAnalysis = Analysis.preserveAnalysis(Function);
// Invalidate analysis for this function.
PM.invalidateAnalysis(Function, InvalidationKind::CFG);
// Update the preserved analysis for this function.
Analysis.updateAnalysis(F, std::move(PreservedAnalysis));
}
Swift SVN r19918
Since we don't have guaranteed preheader insertion (yet). We can have the
situation where the new header (after rotation) is also a header of a nested
loop. In such a case we must bail.
Try harder to created preheader for nested loops though.
Swift SVN r19881