Commit Graph

663 Commits

Author SHA1 Message Date
Mark Lacey
bed0da6472 Typo: consequtive -> consecutive 2015-12-16 22:43:54 -08:00
Mark Lacey
3ed75f4fb0 Move the pass manager's function worklist into PassManager.
Make it a std::vector that reserves enough space based on the number of
functions in the initial bottom-up ordering.

This is the first step in making it possible for function passes to
notify the pass manager of new functions to process.
2015-12-16 21:30:33 -08:00
Mark Lacey
226a825807 Simplify the pass manager execution logic.
Make it a bit more clear that we're alternating between collecting (and
then running) function passes, and running module passes. Removes some
duplication that was present.

Reapplies 9d4d3c8 with fixes for bisecting pass execution.
2015-12-15 15:17:53 -08:00
Mark Lacey
59544560d1 Revert "Simplify the pass manager execution logic."
This reverts commit 9d4d3c8055.

I forgot to finish up changes required to make -Xllvm
-sil-opt-pass-count continue working the way it did, so I'll back that
out until I have those changes as well.
2015-12-15 13:23:59 -08:00
Mark Lacey
9d4d3c8055 Simplify the pass manager execution logic.
Make it a bit more clear that we're alternating between collecting (and
then running) function passes, and running module passes. Removes some
duplication that was present.
2015-12-15 13:08:08 -08:00
Mark Lacey
a8fbc4722f Minor pass manager refactoring.
Extract the code related to running a module pass into a separate
function.
2015-12-15 10:25:38 -08:00
Arnold Schwaighofer
edf9ca06fc Unroll loops with known short trip count
This enables array value propagation in array literal loops like:

for e in [2,3,4] {
  r += e
}

Allowing us to completely get rid of the array.

rdar://19958821
SR-203
2015-12-14 12:03:42 -08:00
Arnold Schwaighofer
6662e7432a Reapply Add a pass to propagate constant array values to array subscript calls
This reverts commit 82ff59c0b9.

Original commit message:

This allows us to compile the function:

func valueArray() -> Int{
  var a = [1,2,3]
  var r = a[0] + a[1] + a[2]
  return r
}

Down to just a return of the value 6. And should eventually allow us to remove
the overhead of vararg calls.

rdar://19958821
2015-12-14 12:03:41 -08:00
Mark Lacey
6c4bc75d3f Use a work list when running function passes.
Rather than iterating over an array of functions, build a work list and
pop functions off of it.

This is a small step towards allowing function passes to create new
functions to be processed.
2015-12-13 20:42:07 -08:00
Michael Gottesman
d94fa0a515 Merge pull request #501 from practicalswift/fix-typos-5
Fix typos (5 of 30)
2015-12-13 18:55:20 -06:00
practicalswift
fdeb03033c Fix typo: classsic → classic 2015-12-14 00:11:23 +01:00
practicalswift
39f3e49e27 Fix typo: analyis → analysis 2015-12-13 23:56:40 +01:00
Andrew Trick
739b0e9c56 Reorganize SILOptimizer directories for better discoverability.
(libraries now)

It has been generally agreed that we need to do this reorg, and now
seems like the perfect time. Some major pass reorganization is in the
works.

This does not have to be the final word on the matter. The consensus
among those working on the code is that it's much better than what we
had and a better starting point for future bike shedding.

Note that the previous organization was designed to allow separate
analysis and optimization libraries. It turns out this is an
artificial distinction and not an important goal.
2015-12-11 15:14:23 -08:00