Commit Graph

11 Commits

Author SHA1 Message Date
Arnold Schwaighofer
83cf4f3405 Add a pass to specialize array code based on array semantic array.props calls
We know that a native swift array that does not need an element type check is
not going to change to an nsarray, or to an array that needs an element type
check. This allows us to specialize array code.

The array semantic calls 'array.props.isCocoa/needsElementTypeCheck' returns
said array properties for a read.

  func f(a : A[AClass]) {
     for i in 0..a.count {
       let b = a.props.isCocoa()
        .. += _getElement(a, i, b)
     }
  }

   ==>

  func f(a : A[AClass]) {
    let b2 = a.props.isCocoa()
    if (!b2) {
      for i in 0..a.count {
         .. += _getElement(a, i, false)
      }
    } else {
      for i in 0..a.count {
        let b = a.props.isCocoa
        .. += _getElement(a, i, b)
      }
    }
  }

The stdlib will be changed to use array.props calls in a future commit.

rdar://17955309

Swift SVN r23689
2014-12-04 19:24:40 +00:00
Ben Langmuir
e9e1666ab0 Update for upstream LLVM changes
* removal of StringMap's GetOrCreateValue
* SmallSet::insert now returns a pair like std::set

Swift SVN r23435
2014-11-19 16:49:30 +00:00
Arnold Schwaighofer
bb47ce9e00 COWArrayOpts: strong_release on the array is also harmless
Needed for the upcoming array implementation change.

rdar://18777237

Swift SVN r23075
2014-11-03 02:18:35 +00:00
Arnold Schwaighofer
e6c44a377b COWArrayOpt: We could (and are now) also use a strong retain on the array storage
Swift SVN r22998
2014-10-29 01:56:14 +00:00
Andrew Trick
2ca16462b2 NFC: Update COW Array pass name string
Swift SVN r21964
2014-09-16 01:56:41 +00:00
Arnold Schwaighofer
12b0e13459 COWArrayOpt: Use ArraySemanticsCall utility
NFC

Swift SVN r21929
2014-09-12 21:05:23 +00:00
Arnold Schwaighofer
6da1647e1f COWArrayOpt: Use ValueBase's getParentBB api
Swift SVN r21927
2014-09-12 21:05:22 +00:00
Michael Gottesman
24c138f29c Move SILLoopInfo into swiftSIL from swiftSILAnalysis so that we match the separation in between analysis and IR entities.
This follows the model of dominance info and allows me to create reachability
methods on SILBasicBlock without creating dependencies from swiftSIL to
swiftSILAnalysis.

Swift SVN r21866
2014-09-11 03:03:06 +00:00
Andrew Trick
bba2a37070 More COWArrayOpts cleanup.
Arnold noticed during review that ArrayUserSet was not properly
updated after previous rounds of cleanup.

This also removes some innefficiency by eliminating a few hash maps.

I want to make sure this is in good shape before reusing the analysis
for immutable array properties.

Swift SVN r21608
2014-08-30 09:20:07 +00:00
Andrew Trick
ed4d8e6b71 Cleanup COWArrayOpts.
Rewrite comments and refactor.

The refactored code now handles the latest SILCombine.

Swift SVN r21547
2014-08-28 22:42:15 +00:00
Andrew Trick
da5a4411bf Rename ArrayOpts to COWArrayOpts.
It looks like we'll have a separate pass for different types of array
opts. There isn't much overlap between COW and ABC opts.

Swift SVN r21258
2014-08-18 18:44:01 +00:00