Commit Graph

10 Commits

Author SHA1 Message Date
Stephen Lin
4ebdf9c80f Capture Promotion: have new closures inserted before their original versions
Swift SVN r10554
2013-11-19 03:29:00 +00:00
Stephen Lin
cacdcabad1 CapturePromotion: correct conditional accidentially reverted in previous commit
Swift SVN r10553
2013-11-19 03:10:38 +00:00
Stephen Lin
1404df0900 CapturePromotion: use existing variable containing callee since it's available
Swift SVN r10552
2013-11-18 23:27:55 +00:00
Stephen Lin
e6ab97ffbd CapturePromotion: Propogate SILLocation from original closure to cloned closure.
Swift SVN r10551
2013-11-18 23:27:53 +00:00
Chris Lattner
4968cc208b A couple of related changes:
- Enhance SILBuilder::emitStrongRelease to be smarter.
- Start using emitStrongRelease in type lowering, SILGen,
  CapturePromotion (replacing its implementation of the
  same logic), and MandatoryInlining (one more place)
- Rename the primitive createStrongRetain/ReleaseInst
  instructions to lose their suffix.
- Now that createStrongRetain/ReleaseInst are not special
  cases from the naming perspective, remove some special cases
  from DeserializeSIL and ParseSIL.
  


Swift SVN r10449
2013-11-14 02:21:27 +00:00
Chris Lattner
a2a1b2af55 Clean up tuple and extract SILBuilder stuff:
- Introduce emitTupleExtract / emitStructExtract, which fold when their operand is a tuple/struct.
- Rename SILBuilder::createTupleExtractInst -> createTupleExtract, "Inst" isn't used as a suffix.
- Switch capture promotion and DI to use the new functions.

This trims 300 lines out of the stdlib.


Swift SVN r9897
2013-11-03 04:47:40 +00:00
Andrew Trick
f1c977889c Added a ReachingBlockSet and ReachingBlockMatrix for efficiency.
Eventually, we may decide not to compute global reachability, but this
should be reasonably efficient in the meantime.

Swift SVN r9691
2013-10-26 09:03:36 +00:00
Chris Lattner
91c7cea310 Remove the SILModule& argument from a few methods in SILInstruction.h.
Instructions know which module they came from, so there is no need to
pass it in.



Swift SVN r9584
2013-10-22 11:06:50 +00:00
Chris Lattner
83d8954d4b Some belated code review of CapturePromotion. Much of it is
minor typographical/style changes and use of simpler/strength
reduced apis (e.g. empty() instead of size() != 0).

Stephen, I added a couple of TODOs for simple ways that the
algorithm could be made better, and added a few FIXMEs for
higher priority things that should be taken care of.  The
biggest issue is that we need to find a better datastructure
for the reachability queries.


Swift SVN r9546
2013-10-21 18:19:14 +00:00
Stephen Lin
94dbad4666 Add (but do not enable by default) a pass for closure capture promotion (rdar://problem/14757727).
Swift SVN r9362
2013-10-15 19:11:54 +00:00