Commit Graph

9 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
16bd756f7b tests: make some test more robust for optimizer changes.
This is in preparation for COW support. More optimizer tests require an optimized non-assert stdlib build.
2020-05-26 18:01:17 +02:00
Erik Eckstein
2e4ecb425e stdlib: make the destructor of _SwiftNativeNSArrayWithContiguousStorage inlinable on linux
... as it is for ObjC runtimes.
This is need for the optimizer to do certain optimizations, like object outlining.

rdar://problem/34758773
2018-01-19 11:32:35 -08:00
eeckstein
b126b62256 Revert "Optimization changes to completely fold OptionSet literals" 2018-01-18 22:05:07 -08:00
Erik Eckstein
228bf53f27 stdlib: make the destructor of _SwiftNativeNSArrayWithContiguousStorage inlinable on linux
... as it is for ObjC runtimes.
This is need for the optimizer to do certain optimizations, like object outlining.

rdar://problem/34758773
2018-01-18 18:27:17 -08:00
Roman Levenstein
a136d59875 XFAIL stack_promotion_array_literal.swift under Linux
rdar://problem/34758773
2017-10-02 14:34:14 -07:00
Erik Eckstein
d9c71e8bd7 EscapeAnalysis: handle fix_lifetime instructions
This fixes wrong reported escapes of the self reference in destructors.

rdar://problem/31409766
2017-04-19 12:31:21 -07:00