Commit Graph

1 Commits

Author SHA1 Message Date
Erik Eckstein
966d617625 SIL optimizer: propagate count and capacity from empty Array/Set/Dictionary singletons.
Constant-propagate the 0 value when loading "count" or "capacity" from the empty Array, Set or Dictionary storage.
On high-level SIL this optimization is also done by the ArrayCountPropagation pass, but only for Array.
And even for Array it's sometimes needed to propagate the empty-array count when high-level semantics function are already inlined.

Fixes an optimization deficiency for empty OptionSet literals.

https://bugs.swift.org/browse/SR-12046
rdar://problem/58861171
2020-01-24 14:47:30 +01:00