This commit splits DominanceAnalysis into two analysis (Dom and PDom) that
can be cached and invalidates using the common FunctionAnalysisBase interface
independent of one another.
Swift SVN r26643
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
TerminatorInsts. Now you can walk over the successor list of a terminator
and actually modify the SILSuccessor directly, allowing better CFG
transformations. NFC.
Swift SVN r26140
SILMem2Reg can now optimize sequences like:
alloc_stack
store whole struct to stack
get struct_element_addr
load struct member from stack
This pattern occurs quite often. And this change can reduce the number of SIL instructions in some functions significantly.
The effect on the benchmarks is not significant (only a few small improvements).
Swift SVN r24917
This starts us in the direction of supporting promotion of
alloc_stack'ed addresses that appear in
debug_value_addr (rdar://problem/19087215), which will get us one step
closer to leaving debug_value/debug_value_addr around in optimized
builds (rdar://problem/18709125). NFC.
Swift SVN r23612
Now the pass does not need to know about the pass manager. We also don't have
runOnFunction or runOnModule anymore because the trnasformation knows
which module it is processing. The Pass itself knows how to invalidate the
analysis, based on the injected pass manager that is internal to the
transformation.
Now our DCE transformation looks like this:
class DCE : public SILModuleTransform {
void run() {
performSILDeadCodeElimination(getModule());
invalidateAnalysis(SILAnalysis::InvalidationKind::All);
}
};
Swift SVN r13598
Thanks to the way we've set up our diagnostics engine, there's not actually
a reason for /everything/ to get rebuilt when /one/ diagnostic changes.
I've split them up into five categories for now: Parse, Sema, SIL, IRGen,
and Frontend, plus a set of "Common" diagnostics that are used in multiple
areas of the compiler. We can massage this later.
No functionality change, but should speed up compile times!
Swift SVN r12438
This commit implements the DJ-graph data-structure and linear time algorithm
for calculating the iterative dominance frontier and placing PHI nodes.
This is the same algorithm that is used by recent versions of LLVM.
Swift SVN r11578
This patch prevents the propagation of PHI-values by using the lifetime markers of the allocation:
1. If the phi value is not dominated by the Allocation then it can't be alive.
2. If the phi value is properly dominated by the deallocation then it must be dead.
Swift SVN r11513