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
In cases like the one below, replace the integer_literal instructions
with the condition branching to the block that the instruction is in.
cond_br %10, bb1, bb3
bb1:
%13 = integer_literal $Builtin.Int1, -1
br bb2(%13 : $Builtin.Int1)
bb3:
%18 = integer_literal $Builtin.Int1, 0
br bb2(%18 : $Builtin.Int1)
Similarly, for
switch_enum %0 : $Bool, case #Bool.true!enumelt: bb1
bb1:
%1 = enum $Bool, #Bool.true!enumelt
we'll replace the enum with %0.
Use this functionality from within the CFG simplification pass to
simplify basic block args in an attempt to expose opportunities for
further CFG simplification.
Swift SVN r9968
all the tuple stuff is out of the way. This kicks in 600 times in the
stdlib and ends up shrinking the stdlib by 2500 lines (down to 53209).
Swift SVN r9903
in simplifycfg. This is intentionally pretty simple, but already kicks in
827 times in the stdlib, and cuts 1000 lines of sil out of it.
Swift SVN r9853
dead blocks (which happens to be incorrect).
Unlike the LLVM SimplifyCFG pass, this one will be worklist-based instead of
iterative, avoiding needless iteration over the entire function when a small
local changes are being made.
Swift SVN r9756