You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked into this briefly and I could be wrong, but it seems like SIL analysis is almost completely oblivious to `Builtin.sizeof()` and the fact that the result is constant.
Note that Builtin.sizeofisn't always a constant, because of resilient structs and enums. But the compiler also knows which types are resilient and which aren't.
Having SIL not knowing anything about datatype sizes (by default) is reasonable and good. That being said, what would go wrong if SIL special cased `Builtin.sizeof` and inlining it when the datatype is known to be fixed sized and fragile?
Environment
swift 4.1 macOS
Additional Detail from JIRA
md5: bacab61987ce077c0e5aca37f8eecfca
Issue Description:
It seems in the following example, Constants.a isn't being identified as a constant, and properly propagated to use sites.
Godbolt link: https://godbolt.org/g/d7ti3U
The text was updated successfully, but these errors were encountered: