Skip to content

Fix SILCombine of convert_escape_to_no_escape ( differentiable_function for OSSA #67992

@meg-gupta

Description

@meg-gupta

The following test fails ownership verification :

// RUN: %target-sil-opt -enable-sil-verify-all %s -sil-combine -sil-combine-canonicalize=false

// SILCombine tests for differentiation-related instructions.

sil_stage canonical

import Swift
import _Differentiation

sil [ossa] @test_convert_escape_to_noescape : $@convention(thin) (@owned @callee_guaranteed (Float) -> Float) -> () {
bb0(%0 : @owned $@callee_guaranteed (Float) -> Float):
  %diff_fn = differentiable_function [parameters 0] [results 0] %0 : $@callee_guaranteed (Float) -> Float
  %1 = convert_escape_to_noescape %diff_fn : $@differentiable(reverse) @callee_guaranteed (Float) -> Float to $@noescape @differentiable(reverse) @callee_guaranteed (Float) -> Float
  %3 = apply undef(%1) : $@convention(thin) (@guaranteed @differentiable(reverse) @noescape @callee_guaranteed (Float) -> Float) -> ()
  destroy_value %1 : $@noescape @differentiable(reverse) @callee_guaranteed (Float) -> Float
  destroy_value %diff_fn : $@differentiable(reverse) @callee_guaranteed (Float) -> Float
  return undef : $()
}

Metadata

Metadata

Assignees

Labels

AutoDiffSIL ownershipArea → compiler → SIL: SIL ownershipSILOptimizerArea → compiler: SIL optimization passesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions