Description
There are some indications that tracking this information might allow to tree-shake more code from AOT compiled applications.
One of the motivating examples would be to fold away defaultTargetPlatform
getter (which returns a constant value based on the target compilation platform) and propagate it's value into the uses - which should enable more constant folding and subsequently tree-shaking of code that is only used on some specific platforms.
There are some challenges associated with it - currently TFA is control-flow insensitive. To successfully propagate defaultTargetPlatform
we would need certain control flow sensitivity. These changes might result in a significant increase in compile times for AOT code - but potential gains are worth the try.