swift
8861918f - [AutoDiff] Allow more VJP inlining decisions (#88922)

Commit
96 days ago
[AutoDiff] Allow more VJP inlining decisions (#88922) Prior to regular inlining decision logic, VJP callees have additional checks since some inlining might harm further AutoDiff Closure Specialization (ADCS) pass logic. This patch relaxes some of these restrictions, allowing more VJP inlining decisions to be taken while still not harming the ADCS optimizations. VJP inlining decisions newly allowed: 1) potential inlining during HighLevel pass pipeline (previously - hard no); 2) derivative thunks callees to any callers; 3) trivial VJPs (no other VJPs called, only top-level pullback) to any callers; 4) any VJPs to VJP callers with control flow which only use the pullback from current apply site directly in their top-level pullback. This patch also introduces best-effort attempt of detection of explicit derivatives by looking at the corresponding `AbstractFunctionDecl` and looking for a `derivative` attr with reverse-mode.
Author
Parents
Loading