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
I am going to use this in a forthcoming patch which creates a special mode
called "ParanoidVerification" which runs the verifier after all passes.
"ParanoidVerification" will be by default off and will be used on the swift-fast
buildbot to help catch bugs which might be hidden by optimizations being run.
Swift SVN r13256
Part of the migration to the new driver. With this commit, the only
failures in the test suite using the new frontend are features we don't
intend to port over. Hooray!
Swift SVN r13198
Plumbing this through to the inliner necessitated the creation of a
SILOptions class (like FrontendOptions and IRGenOptions). I'll move
more things into this soon.
One change: for compatibility with the new driver, the option must be
specified as "-sil-inline-threshold 50" instead of "-sil-inline-threshold=50".
(We're really trying to be consistent about joined-equals vs. separate
in the new frontend.)
Swift SVN r13193
This pass attempts to remove alloc_ref and everything that uses the alloc_ref
if:
1. The alloc_ref has a destructor which we can very does not have escaping side
effects.
2. The alloc_ref does not have any non-trivial uses that are not stores.
It reduces ObjInst on my cpu from 10206922128 ns to 46 ns (i.e. nothing).
Swift SVN r12990
For simplicity it currently only moves copy_values, strong_retains since we are
not doing the data flow analysis yet.
Even with its limitations (which are extreme), we are removing ~400
retain/release/copyvalue/destroyvalue pairs from the standard library.
Additionally we reduce the time RC4 takes from 7.5-5.5 (2 second delta).
Swift SVN r12264
The main difference is that the specializer is moved to the beginning of the pipe. This makes sense because it does not depends on other optimizations.
Swift SVN r11738
copy_addr, destroy_addr into their constituant parts without performing any
chopping to unblock Nadav.
The plan is to use type lowering to chop these up and then rewrite afterwards.
But for now I want to unblock Nadav.
Swift SVN r11728
The compile times of stdlib drops by a few seconds and the code quality of a few small testcases that
I have been playing with improves.
Swift SVN r11718
This is a very initial version mostly to get machinery in place before we start
considering more interesting things.
Specifically we do not:
1. Inline functions with any substitutions.
2. Inline functions that are not thin.
3. Inline functions in any recursive manner (i.e. we just follow the call tree
and inline until we run out of cost).
4. Remove functions that we have completely inlined as a good citizen should.
Additionally the cost model is purposely simplistic and assumes that every SIL
instruction is one to one with an LLVM instruction (when many do not become any
LLVM instruction and others become 2). The idea is simply to put a cost on the
total increase in code size we allow due to inlining in a specific function.
Thus we just continually inline until we run out our inlining budget.
Even with the current limitations we inline 1248 apply inst in the stdlib when
setting a cost threshold of 225.
Swift SVN r11596
Added a new Passes.cpp file to swiftSILPasses, which contains the general SIL pass-related functions.
Moved runSILDiagnosticPasses and runSILOptimizationPasses from tools/swift/Helpers.cpp to lib/SILPasses/Passes.cpp so that the functions can be shared by swift and swift_driver.
Swift SVN r11382