swift
4ebb9104 - [AutoDiff] Add `differentiability_witness_function` instruction. (#27719)

Commit
5 years ago
[AutoDiff] Add `differentiability_witness_function` instruction. (#27719) `differentiability_witness_function` looks up a differentiability witness function (JVP, VJP, or transpose) for a referenced function using SIL differentiability witnesses. ``` %vjp = differentiability_witness_function [vjp] [parameters 0 1] [results 0] \ <T where T: Differentiable, T == T.TangentVector> \ @generic : $@convention(thin) <T> (@in_guaranteed T, Float) -> @out T ``` The differentiability witness function kind identifies the witness function to look up: ``[jvp]``, ``[vjp]``, or ``[transpose]``. The remaining components identify the SIL differentiability witness: - Original function name. - Parameter indices. - Result indices. - Witness generic signature (optional). When parsing SIL, the parsed witness generic signature is combined with the original function's generic signature to form the full witness generic signature. Resolves TF-915.
Author
Parents
  • docs
    • File
      SIL.rst
  • include/swift
    • AST
      • File
        AutoDiff.h
      • File
        DiagnosticsParse.def
    • SIL
      • File
        SILBuilder.h
      • File
        SILCloner.h
      • File
        SILInstruction.h
      • File
        SILNodes.def
  • lib
    • AST
      • File
        AutoDiff.cpp
    • IRGen
      • File
        IRGenSIL.cpp
    • ParseSIL
      • File
        ParseSIL.cpp
    • SIL
      • File
        OperandOwnership.cpp
      • File
        SILInstructions.cpp
      • File
        SILPrinter.cpp
      • File
        ValueOwnership.cpp
    • SILOptimizer/Utils
      • File
        SILInliner.cpp
    • Serialization
      • File
        DeserializeSIL.cpp
      • File
        SILFormat.h
      • File
        Serialization.cpp
      • File
        SerializeSIL.cpp
  • test/AutoDiff
    • differentiability_witness_function_inst.sil