Commit Graph

4 Commits

Author SHA1 Message Date
Erik Eckstein
cad646b283 re-implement the StackPromotion pass in swift
It uses the new EscapeInfo.
2022-05-02 14:22:27 +02:00
Arnold Schwaighofer
cc8a86b2f3 Optimize array.getContiguousArrayStorageType calls 2022-02-16 13:21:12 -08:00
Arnold Schwaighofer
9f2b6a4ebb Reuse _ContiguousArrayStorage<AnyObject> metadata for any class or objc generic type
Reduces the number of _ContiguousArrayStorage metadata.

In order to support constant time bridging we do need to set the correct
metadata when we bridge to Objective-C. This is so that the type check
succeeds when bridging back from Objective-C to reuse the storage
instance rather than bridging the elements.

To support dynamically setting the `_ContiguousArrayStorage` element
type i needed to add support for optimizing `alloc_ref_dynamic`
throughout the optimizer.

Possible future improvements:
* Use different metadata such that we can disambiguate native Swift
  classes during destruction -- allowing native release rather then unknown
  release usage.
* Optimize the newly added semantic function
  getContiguousArrayStorageType

rdar://86171143
2022-02-16 07:55:34 -08:00
Erik Eckstein
6569c98332 SIL optimizer: add an additional stack promotion pass to the late pipeline
Sometimes stack promotion can catch cases only at a late stage of the pipeline, after FunctionSignatureOpts.

https://bugs.swift.org/browse/SR-12773
rdar://problem/63068408
2020-05-28 10:23:40 +02:00