Commit Graph

17 Commits

Author SHA1 Message Date
Chris Lattner
a7a54734c8 revert rr26760: SILPassManager: Further reduce the number of pass runs
this unbreaks the stdlib build with assertions enabled.


Swift SVN r26763
2015-03-31 16:47:15 +00:00
Erik Eckstein
1110dc6cd4 SILPassManager: Further reduce the number of pass runs.
Avoid running a pass a second time if the pass has its own optimize-until-no-more-changes loop.
This pass property can be configured.
Currently I assume that all our function passes don't need to run a second time (without other changes in between).

It further reduces the number of pass runs by about 6%. But this improvement is cosmetic. There is no significant compile time reduction.

There are no performance changes.



Swift SVN r26760
2015-03-31 15:54:42 +00:00
Erik Eckstein
f520ef894a Add the PassKind as a property in SILTransform.
To set the PassKind automatically, I needed to refactor some code of the pass manager and the pass definitions.
The main changes are:
1) SILPassManager now has an add-function for each pass: PM.add(createP()) -> PM.addP()
2) I removed the ARGS argument in Passes.def, which we didn't use anyway.



Swift SVN r26756
2015-03-31 14:08:19 +00:00
Nadav Rotem
adeebd81d7 [PM] Expose the invalidation API. NFC.
Currently the analysis invalidation API is marked as 'protected', which
means that only the pass itself can invalidate analysis. However, we have
utility functions that should invalidate analysis selectively. Exposing
the invalidation API will allow us to pass the pass to the utility and allow
it to invalidate analysis selectively.

Swift SVN r26459
2015-03-23 23:57:41 +00:00
Nadav Rotem
d78b376d07 [passes] Replace the old invalidation lattice with a new invalidation scheme.
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
2015-03-23 21:18:58 +00:00
Nadav Rotem
48f84e1132 [PM] Add API for module passes to invalidate a specific function.
Swift SVN r26371
2015-03-20 22:53:04 +00:00
Michael Gottesman
b2d9833259 Add PrettyStackTrace support for SILFunctionTransforms and SILModuleTransforms.
In the case of a crash in the optimizer or verifier, this prints out information
about the source of the crash. This saves engineering time by allowing one to
get some quick information about the crash without needing to jump into the
buffer.

In the case of a SILFunctionTransform, this prints out the name of the function
being optimized and the name of the transform.

In the case of a SILModuleTransform, this prints out the name of the transform.

<rdar://problem/19946491>

Swift SVN r25831
2015-03-07 03:08:28 +00:00
Michael Gottesman
123b8e6f61 Access SILOptions in SILPassManager via the SILModule now that we store the SILOptions in the SILPassManager.
Swift SVN r23651
2014-12-03 20:39:05 +00:00
Nadav Rotem
6a0f2cfcb8 remove more extra semicolons to clean up warnings.
Swift SVN r15486
2014-03-26 05:44:41 +00:00
Nadav Rotem
29cb91a988 Add names to two passes with missing names. Mark the getName method as abstract. Thanks Michael!
Swift SVN r14243
2014-02-21 23:38:17 +00:00
Andrew Trick
731000b4cd Added -sil-print-all and -sil-verify-all options.
Swift SVN r13662
2014-02-07 23:07:11 +00:00
Andrew Trick
47b936fbae Let passes get their options (current configuration) from the
PassManager.

I think this is much cleaner and more flexible. The various pass
builders have no business marshalling these things around, and they
shouldn't be bound to the pass C'tor. In the future we will be able
override and dynamically modify pass configuration this way.

Swift SVN r13626
2014-02-07 05:01:00 +00:00
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
99b075c32a Rename SILFunctionTrans -> SILFunctionTransform
Swift SVN r13536
2014-02-06 01:32:10 +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
72169c305d Initial swift pass manager.
Swift SVN r13492
2014-02-05 18:56:16 +00:00