Nadav Rotem
27a1a63134
Remove unneeded empty virtual destructors.
...
Swift SVN r13599
2014-02-06 22:24:33 +00:00
Nadav Rotem
1ef0d157ca
PassManager: Inject the function/module into the Transformation.
...
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
2014-02-06 22:11:21 +00:00
Nadav Rotem
fda4a88be5
Teach the codemotion pass not to invalidate the analysis if no change was made.
...
Swift SVN r13590
2014-02-06 18:06:57 +00:00
Michael Gottesman
3b43e09bae
Change getAnalysis<T> to be asserting and provide a new entry point getAnalysisOrNull<T>. Remove all of the unneeded asserts in the various passes.
...
Swift SVN r13576
2014-02-06 10:06:18 +00:00
Michael Gottesman
80f1451534
[sil-code-motion] Put in assert to make sure we always get a non-null alias analysis. The only way this can happen is if someone is careless and does not add the alias analysis to the pass manager.
...
Swift SVN r13551
2014-02-06 02:31:43 +00:00
Michael Gottesman
098fda670f
[sil-aa] Change SIL AliasAnalysis into an Analysis.
...
Swift SVN r13550
2014-02-06 02:29:41 +00:00
Nadav Rotem
99b075c32a
Rename SILFunctionTrans -> SILFunctionTransform
...
Swift SVN r13536
2014-02-06 01:32:10 +00:00
Nadav Rotem
f8c7b54d28
Delete the unused performXXX() functions.
...
Swift SVN r13531
2014-02-06 00:57:28 +00:00
Michael Gottesman
7461dbd70a
Now that we have a PM, separate passes from analyses by creating a separate library swiftSILAnalysis and a separate folder/etc.
...
Swift SVN r13511
2014-02-05 22:17:50 +00:00
Michael Gottesman
631f9326ab
[PM] Change enum => enum class everywhere in the PM code. Additionally fix some typos.
...
Swift SVN r13507
2014-02-05 21:25:15 +00:00
Nadav Rotem
baa1d1679a
Teach some of the passes about the new PM.
...
Swift SVN r13494
2014-02-05 18:58:23 +00:00
Michael Gottesman
473927a1ed
[sil-codemotion] Added debug statements to promoteMemoryOperationsInBlock().
...
Swift SVN r13460
2014-02-05 00:30:35 +00:00
Michael Gottesman
e066574abe
[sil-codemotion] After seeing a store only invalidate loads that we can not prove it does not write to.
...
Swift SVN r13458
2014-02-05 00:27:00 +00:00
Michael Gottesman
f1e247e399
[sil-aa] Convert AliasAnalysis::alias(SILInstruction *, SILValue) -> AliasAnalysis::getMemoryBehavior(SILInstruction *, SILValue).
...
AliasAnalysis::getMemoryBehavior() returns a SILInstruction::MemoryBehavior
object that specifies the memory behavior of the SILInstruction with respect to
the SILValue. This name fits better the intention behind the aforementioned
poorly named alias instruction.
This is analogous to memdep in LLVM, except using the enum values from
SILInstruction::MemoryBehavior since we already have them.
Currently it always returns the most conservative answer, MayHaveSideEffects for
everything.
The patch also updates SILCodeMotion in light of these changes.
Swift SVN r13457
2014-02-05 00:26:59 +00:00
Michael Gottesman
1d1de86f37
[sil-code-motion] If we find an Inst that can not be proven to not alias a load, only invalidate that load instead of all of the loads.
...
Swift SVN r13382
2014-02-03 23:05:03 +00:00
Michael Gottesman
8789bd3b51
Small cleanup. NFC.
...
Swift SVN r13329
2014-02-03 02:34:01 +00:00
Michael Gottesman
bbdfb8bcad
[sil-code-motion] Teach SILCodeMotion how to use the AliasAnalysis infrastructure.
...
Swift SVN r13328
2014-02-03 02:34:00 +00:00
Michael Gottesman
33a8cc36a2
[codemotion] CondFail does not cause us to read/write memory in a manner that we care about.
...
Swift SVN r13323
2014-02-03 00:11:14 +00:00
Michael Gottesman
ebf12a9b9c
Recommit r13291 with proper tests, etc.
...
Swift SVN r13304
2014-02-01 21:00:07 +00:00
Michael Gottesman
934e0756db
Revert "[sil-code-motion] Read none builtins can not cause reads or writes. Don't let them disrupt load/store forwarding."
...
This reverts commit r13291. Had a thinko here.
Swift SVN r13303
2014-02-01 19:20:41 +00:00
Michael Gottesman
3fa7c641b1
[sil-code-motion] Read none builtins can not cause reads or writes. Don't let them disrupt load/store forwarding.
...
Swift SVN r13291
2014-02-01 05:51:19 +00:00
Michael Gottesman
091cdb499e
[sil-code-motion] Rename statistics so they dont have CSE in the name since CodeMotion is a separate pass now.
...
Swift SVN r13153
2014-01-30 17:53:03 +00:00
Nadav Rotem
312448756d
whitespace.
...
Swift SVN r13151
2014-01-30 17:34:38 +00:00
Nadav Rotem
230842221e
Move the code motion optimizations into a new pass. NFC.
...
Swift SVN r13150
2014-01-30 17:32:57 +00:00