Improving the representation of polymorphic interfaces in SIL with "substituted function types"

Thank you for explaining the substituted SIL function type design!

I wonder if the substituted SIL function type design is stabilizing soon? I saw "Use pattern substitutions to consistently abstract yields" (#30309) landed recently, are more significant changes coming?


These changes heavily broke Swift differentiable programming on the tensorflow branch when we merged master -> tensorflow:

These issues surfaced in the master -> tensorflow merge because Swift differentiable programming (end-to-end infra and tests) haven't been sufficiently upstreamed to master yet.

As soon as we fix these issues, we plan to focus on upstreaming SIL-related differentiable programming infra to be robust against future changes. Individual upstreaming PRs may be a good place for code review (e.g. SILFunctionType::getAutoDiffDerivativeFunctionType derivative type calculation and how it works with substituted function types).