Before

…lines 1–7 unchanged (7 lines)
8// RUN: %target-codesign %t/none.out
9// RUN: %target-codesign %t/opt.out
10// RUN: %target-run %t/none.out
11// RUN: %target-run %t/opt.out
12
13// RUN: %target-swift-frontend -emit-sil %s -O -o %t/out.sil
14
15// TODO: Re-enable these tests once we have OSSA throughout the pipeline.
16// AutoDiff Closure Specialization pass runs twice, but at the second
17// run we currently do not perform any transformation because ownership
18// eliminator is run before. Disabled tests below rely on the second
19// pass run performing transformation, so they currently fail.
20// https://github.com/swiftlang/swift/issues/84920
21// TODO: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK1
22// TODO: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK2
23
24// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK3
25// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK4
26
27import DifferentiationUnittest
28import StdlibUnittest
29
30var AutoDiffClosureSpecMultiBBNoBTETests = TestSuite("AutoDiffClosureSpecMultiBBNoBTE")
31
32typealias FloatArrayTan = Array<Float>.TangentVector
33
34AutoDiffClosureSpecMultiBBNoBTETests.testWithLeakChecking("Test1") {
35 // CHECK1-LABEL: {{^}}// reverse-mode derivative of sumFirstThreeConcatenating1 #1 (_:_:)
36 // CHECK1-NEXT: sil private @$s3outyycfU_27sumFirstThreeConcatenating1L_ySfSaySfG_ACtFTJrSSpSr : $@convention(thin) (@guaranteed Array<Float>, @guaranteed Array<Float>) -> (Float, @owned @callee_guaranteed (Float) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)) {
37 // CHECK1: %[[#E52:]] = function_ref @$s3outyycfU_27sumFirstThreeConcatenating1L_ySfSaySfG_ACtFTJpSSpSr055$sSfSa16_DifferentiationAA14DifferentiableRzlE0B4ViewVyg8_GIegno_G10AEIegyo_TRSfSa01_I0AE0K0RzlE0kO0VySf_GIegno_ADSfAIIegno_0f5Sf16_i26E7_vjpAdd3lhs3rhsSf5value_g17_SftSfc8pullbacktg1_y5FZSf_Y6SfcfU_ADSfAIIegno_AJTf1nnccccc_n0fh1_ijkl4E13_v32Subscript5indexx5value_SaA2aBRzlmnO59Vy13TangentVectorQz_GAIc8pullbacktSi_tFAKL_yAjiaBRzlFSf_TG5ACSiAkCSiAkCSiTf1nnccc_n : $@convention(thin) (Float, @owned @callee_guaranteed (@guaranteed Array<Float>.DifferentiableView) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView), @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)
38 // CHECK1: %[[#E53:]] = partial_apply [callee_guaranteed] %[[#E52]](%[[#]], %[[#]], %[[#]], %[[#]], %[[#]], %[[#]], %[[#]]) : $@convention(thin) (Float, @owned @callee_guaranteed (@guaranteed Array<Float>.DifferentiableView) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView), @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)
39 // CHECK1: %[[#E55:]] = tuple (%[[#]], %[[#E53]])
40 // CHECK1: return %[[#E55]]
41 // CHECK1: } // end sil function '$s3outyycfU_27sumFirstThreeConcatenating1L_ySfSaySfG_ACtFTJrSSpSr'
42
43 // CHECK1-NONE: {{^}}// pullback of sumFirstThreeConcatenating1
44 // CHECK1: {{^}}// specialized pullback of sumFirstThreeConcatenating1
45 // CHECK1: sil private @$s3outyycfU_27sumFirstThreeConcatenating1L_ySfSaySfG_ACtFTJpSSpSr055$sSfSa16_DifferentiationAA14DifferentiableRzlE0B4ViewVyg8_GIegno_G10AEIegyo_TRSfSa01_I0AE0K0RzlE0kO0VySf_GIegno_ADSfAIIegno_0f5Sf16_i26E7_vjpAdd3lhs3rhsSf5value_g17_SftSfc8pullbacktg1_y5FZSf_Y6SfcfU_ADSfAIIegno_AJTf1nnccccc_n0fh1_ijkl4E13_v32Subscript5indexx5value_SaA2aBRzlmnO59Vy13TangentVectorQz_GAIc8pullbacktSi_tFAKL_yAjiaBRzlFSf_TG5ACSiAkCSiAkCSiTf1nnccc_nTf4ngnnnnnn_n : $@convention(thin) (Float, @guaranteed @callee_guaranteed (@guaranteed Array<Float>.DifferentiableView) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView), @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView) {
46 func sumFirstThreeConcatenating1(_ a: [Float], _ b: [Float]) -> Float {
47 let c = a + b
48 return c[0] + c[1] + c[2]
49 }
50
51 expectEqual(
…lines 52–58 unchanged (7 lines)
59 gradient(at: [], [0, 0, 0, 0], of: sumFirstThreeConcatenating1))
60}
61
62AutoDiffClosureSpecMultiBBNoBTETests.testWithLeakChecking("Test2") {
63 // CHECK2-LABEL: {{^}}// reverse-mode derivative of sumFirstThreeConcatenating2 #1 (_:_:)
64 // CHECK2-NEXT: sil private @$s3outyycfU0_27sumFirstThreeConcatenating2L_ySfSaySfG_ACtFTJrSSpSr : $@convention(thin) (@guaranteed Array<Float>, @guaranteed Array<Float>) -> (Float, @owned @callee_guaranteed (Float) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)) {
65 // CHECK2: %[[#E52:]] = function_ref @$s3outyycfU0_27sumFirstThreeConcatenating2L_ySfSaySfG_ACtFTJpSSpSr055$sSfSa16_DifferentiationAA14DifferentiableRzlE0B4ViewVyg8_GIegno_G10AEIegyo_TRSfSa01_I0AE0K0RzlE0kO0VySf_GIegno_ADSfAIIegno_0f5Sf16_i26E7_vjpAdd3lhs3rhsSf5value_g17_SftSfc8pullbacktg1_y5FZSf_Y6SfcfU_ADSfAIIegno_AJTf1nnccccc_n0fh1_ijkl4E10_v25Appendyyt5value_SaA2aBRzlmno55Vy13TangentVectorQz_GAIzc8pullbacktSayxGz_AKtFZA2IzcfU_G4_Tg5Si0fh1_ijkl4E13_v32Subscript5indexx5value_SaA2aBRzlmnO59Vy13TangentVectorQz_GAIc8pullbacktSi_tFAKL_yAjiaBRzlFSf_TG5ACSiAlCSiAlCSiTf1ncccc_n : $@convention(thin) (Float, Int, @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)
66 // CHECK2: %[[#E53:]] = partial_apply [callee_guaranteed] %[[#E52]](%[[#]], %[[#]], %[[#]], %[[#]], %[[#]], %[[#]], %[[#]]) : $@convention(thin) (Float, Int, @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)
67 // CHECK2: %[[#E55:]] = tuple (%[[#]], %[[#E53]])
68 // CHECK2: return %[[#E55]]
69 // CHECK2: } // end sil function '$s3outyycfU0_27sumFirstThreeConcatenating2L_ySfSaySfG_ACtFTJrSSpSr'
70
71 // CHECK2-NONE: {{^}}// pullback of sumFirstThreeConcatenating2
72 // CHECK2: {{^}}// specialized pullback of sumFirstThreeConcatenating2
73 // CHECK2: sil private @$s3outyycfU0_27sumFirstThreeConcatenating2L_ySfSaySfG_ACtFTJpSSpSr055$sSfSa16_DifferentiationAA14DifferentiableRzlE0B4ViewVyg8_GIegno_G10AEIegyo_TRSfSa01_I0AE0K0RzlE0kO0VySf_GIegno_ADSfAIIegno_0f5Sf16_i26E7_vjpAdd3lhs3rhsSf5value_g17_SftSfc8pullbacktg1_y5FZSf_Y6SfcfU_ADSfAIIegno_AJTf1nnccccc_n0fh1_ijkl4E10_v25Appendyyt5value_SaA2aBRzlmno55Vy13TangentVectorQz_GAIzc8pullbacktSayxGz_AKtFZA2IzcfU_G4_Tg5Si0fh1_ijkl4E13_v32Subscript5indexx5value_SaA2aBRzlmnO59Vy13TangentVectorQz_GAIc8pullbacktSi_tFAKL_yAjiaBRzlFSf_TG5ACSiAlCSiAlCSiTf1ncccc_n : $@convention(thin) (Float, Int, @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView) {
74
75 func sumFirstThreeConcatenating2(_ a: [Float], _ b: [Float]) -> Float {
76 var c = a
77 c += b
78 return c[0] + c[1] + c[2]
79 }
…lines 80–201 unchanged (122 lines)

After

…lines 1–7 unchanged (7 lines)
8// RUN: %target-codesign %t/none.out
9// RUN: %target-codesign %t/opt.out
10// RUN: %target-run %t/none.out
11// RUN: %target-run %t/opt.out
12
13// RUN: %target-swift-frontend -emit-sil %s -O -o %t/out.sil
14
15// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK1
16// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK2
17// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK3
18// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK4
19
20import DifferentiationUnittest
21import StdlibUnittest
22
23var AutoDiffClosureSpecMultiBBNoBTETests = TestSuite("AutoDiffClosureSpecMultiBBNoBTE")
24
25typealias FloatArrayTan = Array<Float>.TangentVector
26
27AutoDiffClosureSpecMultiBBNoBTETests.testWithLeakChecking("Test1") {
28 // CHECK1-LABEL: {{^}}// reverse-mode derivative of sumFirstThreeConcatenating1 #1 (_:_:)
29 // CHECK1-NEXT: sil private @$s3outyycfU_27sumFirstThreeConcatenating1L_ySfSaySfG_ACtFTJrSSpSr : $@convention(thin) (@guaranteed Array<Float>, @guaranteed Array<Float>) -> (Float, @owned @callee_guaranteed (Float) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)) {
30 // CHECK1: %[[#E52:]] = function_ref @$s3outyycfU_27sumFirstThreeConcatenating1L_ySfSaySfG_ACtFTJpSSpSr0138$sSa16_DifferentiationAA14DifferentiableRzlE13_vjpSubscript5indexx5value_SaA2aBRzlE0B4ViewVy13TangentVectorQz_GAIc8pullbacktSi_tFAKL_yAjiaQ7FSf_TG5ACSiAdCSi0f5Sf16_h3E7_M59Add3lhs3rhsSf5value_Sf_SftSfc8pullbacktSf_SftFZSf_SftSfcfU_AdCSiAETf1nnccccc_n : $@convention(thin) (Float, @owned @callee_guaranteed (@guaranteed Array<Float>.DifferentiableView) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView), @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)
31 // CHECK1: %[[#E53:]] = partial_apply [callee_guaranteed] %[[#E52]](%[[#]], %[[#]], %[[#]], %[[#]], %[[#]], %[[#]], %[[#]]) : $@convention(thin) (Float, @owned @callee_guaranteed (@guaranteed Array<Float>.DifferentiableView) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView), @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)
32 // CHECK1: %[[#E55:]] = tuple (%[[#]], %[[#E53]])
33 // CHECK1: return %[[#E55]]
34 // CHECK1: } // end sil function '$s3outyycfU_27sumFirstThreeConcatenating1L_ySfSaySfG_ACtFTJrSSpSr'
35
36 // CHECK1-NONE: {{^}}// pullback of sumFirstThreeConcatenating1
37 // CHECK1: {{^}}// specialized pullback of sumFirstThreeConcatenating1
38 // CHECK1: sil private {{.*}}@$s3outyycfU_27sumFirstThreeConcatenating1L_ySfSaySfG_ACtFTJpSSpSr0138$sSa16_DifferentiationAA14DifferentiableRzlE13_vjpSubscript5indexx5value_SaA2aBRzlE0B4ViewVy13TangentVectorQz_GAIc8pullbacktSi_tFAKL_yAjiaQ7FSf_TG5ACSiAdCSi0f5Sf16_h3E7_M59Add3lhs3rhsSf5value_Sf_SftSfc8pullbacktSf_SftFZSf_SftSfcfU_AdCSiAETf1nnccccc_n : $@convention(thin) (Float, @owned @callee_guaranteed (@guaranteed Array<Float>.DifferentiableView) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView), @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView) {
39 func sumFirstThreeConcatenating1(_ a: [Float], _ b: [Float]) -> Float {
40 let c = a + b
41 return c[0] + c[1] + c[2]
42 }
43
44 expectEqual(
…lines 45–51 unchanged (7 lines)
52 gradient(at: [], [0, 0, 0, 0], of: sumFirstThreeConcatenating1))
53}
54
55AutoDiffClosureSpecMultiBBNoBTETests.testWithLeakChecking("Test2") {
56 // CHECK2-LABEL: {{^}}// reverse-mode derivative of sumFirstThreeConcatenating2 #1 (_:_:)
57 // CHECK2-NEXT: sil private @$s3outyycfU0_27sumFirstThreeConcatenating2L_ySfSaySfG_ACtFTJrSSpSr : $@convention(thin) (@guaranteed Array<Float>, @guaranteed Array<Float>) -> (Float, @owned @callee_guaranteed (Float) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)) {
58 // CHECK2: %[[#E52:]] = function_ref @$s3outyycfU0_27sumFirstThreeConcatenating2L_ySfSaySfG_ACtFTJpSSpSr144$sSa16_DifferentiationAA14DifferentiableRzlE10_vjpAppendyyt5value_SaA2aBRzlE0B4ViewVy13TangentVectorQz_GAIzc8pullbacktSayxGz_AKtFZA2IzcfU_Sf_Tg5Si0fg1_hijk4E13_m23Subscript5indexx5value_opqrstuvwx29_GAIc8pullbacktSi_tFAKL_yAjiaQ7FSf_TG5ACSiAeCSi0f5Sf16_h3E7_M59Add3lhs3rhsSf5value_Sf_SftSfc8pullbacktSf_SftFZSf_SftSfcfU_AeCSiAFTf1ncccccc_n : $@convention(thin) (Float, Int, @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)
59 // CHECK2: %[[#E53:]] = partial_apply [callee_guaranteed] %[[#E52]](%[[#]], %[[#]], %[[#]], %[[#]], %[[#]], %[[#]], %[[#]]) : $@convention(thin) (Float, Int, @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView)
60 // CHECK2: %[[#E55:]] = tuple (%[[#]], %[[#E53]])
61 // CHECK2: return %[[#E55]]
62 // CHECK2: } // end sil function '$s3outyycfU0_27sumFirstThreeConcatenating2L_ySfSaySfG_ACtFTJrSSpSr'
63
64 // CHECK2-NONE: {{^}}// pullback of sumFirstThreeConcatenating2
65 // CHECK2: {{^}}// specialized pullback of sumFirstThreeConcatenating2
66 // CHECK2: sil private {{.*}}@$s3outyycfU0_27sumFirstThreeConcatenating2L_ySfSaySfG_ACtFTJpSSpSr144$sSa16_DifferentiationAA14DifferentiableRzlE10_vjpAppendyyt5value_SaA2aBRzlE0B4ViewVy13TangentVectorQz_GAIzc8pullbacktSayxGz_AKtFZA2IzcfU_Sf_Tg5Si0fg1_hijk4E13_m23Subscript5indexx5value_opqrstuvwx29_GAIc8pullbacktSi_tFAKL_yAjiaQ7FSf_TG5ACSiAeCSi0f5Sf16_h3E7_M59Add3lhs3rhsSf5value_Sf_SftSfc8pullbacktSf_SftFZSf_SftSfcfU_AeCSiAFTf1ncccccc_n : $@convention(thin) (Float, Int, @owned Array<Float>, Int, @owned Array<Float>, Int, @owned Array<Float>, Int) -> (@owned Array<Float>.DifferentiableView, @owned Array<Float>.DifferentiableView) {
67
68 func sumFirstThreeConcatenating2(_ a: [Float], _ b: [Float]) -> Float {
69 var c = a
70 c += b
71 return c[0] + c[1] + c[2]
72 }
…lines 73–194 unchanged (122 lines)

Before

source_file
comment "/// Multi basic block VJP, pullback not accepting branch tra"...
comment "// REQUIRES: executable_test"
comment "// RUN: %empty-directory(%t)"
comment "// RUN: %target-build-swift %s -o %t/none.out -Onone"
comment "// RUN: %target-build-swift %s -o %t/opt.out -O"
comment "// RUN: %target-codesign %t/none.out"
comment "// RUN: %target-codesign %t/opt.out"
comment "// RUN: %target-run %t/none.out"
comment "// RUN: %target-run %t/opt.out"
comment "// RUN: %target-swift-frontend -emit-sil %s -O -o %t/out.sil"
comment "// TODO: Re-enable these tests once we have OSSA throughout "...
comment "// AutoDiff Closure Specialization pass runs twice, bu"...
comment "// run we currently do not perform any transformation "...
comment "// eliminator is run before. Disabled tests below rely"...
comment "// pass run performing transformation, so they current"...
comment "// https://github.com/swiftlang/swift/issues/84920"
comment "// TODO: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK"...
comment "// TODO: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK"...
comment "// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK3"
comment "// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK4"
import_declaration
import "import"
identifier
simple_identifier "DifferentiationUnittest"
import_declaration
import "import"
identifier
simple_identifier "StdlibUnittest"
property_declaration
value_binding_pattern
var "var"
pattern
simple_identifier "AutoDiffClosureSpecMultiBBNoBTETests"
= "="
call_expression
simple_identifier "TestSuite"
call_suffix
value_arguments
( "("
value_argument
line_string_literal
" "\""
line_str_text "AutoDiffClosureSpecMultiBBNoBTE"
" "\""
) ")"
typealias_declaration
typealias "typealias"
type_identifier "FloatArrayTan"
= "="
user_type
type_identifier "Array"
type_arguments
< "<"
user_type
type_identifier "Float"
> ">"
. "."
type_identifier "TangentVector"
call_expression
navigation_expression
simple_identifier "AutoDiffClosureSpecMultiBBNoBTETests"
navigation_suffix
. "."
simple_identifier "testWithLeakChecking"
call_suffix
value_arguments
( "("
value_argument
line_string_literal
" "\""
line_str_text "Test1"
" "\""
) ")"
lambda_literal
{ "{"
comment "// CHECK1-LABEL: {{^}}// reverse-mode derivative of sumFirst"...
comment "// CHECK1-NEXT: sil private @$s3outyycfU_27sumFirstThreeCon"...
comment "// CHECK1: %[[#E52:]] = function_ref @$s3outyycfU_27"...
comment "// CHECK1: %[[#E53:]] = partial_apply [callee_guaran"...
comment "// CHECK1: %[[#E55:]] = tuple (%[[#]], %[[#E53]])"
comment "// CHECK1: return %[[#E55]]"
comment "// CHECK1: } // end sil function '$s3outyycfU_27sumFir"...
comment "// CHECK1-NONE: {{^}}// pullback of sumFirstThreeConcatenat"...
comment "// CHECK1: {{^}}// specialized pullback of sumFirstThr"...
comment "// CHECK1: sil private @$s3outyycfU_27sumFirstThreeCon"...
statements (+301 nodes collapsed)
} "}"
call_expression
navigation_expression
simple_identifier "AutoDiffClosureSpecMultiBBNoBTETests"
navigation_suffix
. "."
simple_identifier "testWithLeakChecking"
call_suffix
value_arguments
( "("
value_argument
line_string_literal
" "\""
line_str_text "Test2"
" "\""
) ")"
lambda_literal
{ "{"
comment "// CHECK2-LABEL: {{^}}// reverse-mode derivative of sumFirst"...
comment "// CHECK2-NEXT: sil private @$s3outyycfU0_27sumFirstThreeCo"...
comment "// CHECK2: %[[#E52:]] = function_ref @$s3outyycfU0_2"...
comment "// CHECK2: %[[#E53:]] = partial_apply [callee_guaran"...
comment "// CHECK2: %[[#E55:]] = tuple (%[[#]], %[[#E53]])"
comment "// CHECK2: return %[[#E55]]"
comment "// CHECK2: } // end sil function '$s3outyycfU0_27sumFi"...
comment "// CHECK2-NONE: {{^}}// pullback of sumFirstThreeConcatenat"...
comment "// CHECK2: {{^}}// specialized pullback of sumFirstThr"...
comment "// CHECK2: sil private @$s3outyycfU0_27sumFirstThreeCo"...
statements (+303 nodes collapsed)
} "}"
call_expression (+302 nodes collapsed)
call_expression (+407 nodes collapsed)
call_expression
simple_identifier "runAllTests"
call_suffix
value_arguments
( "("
) ")"

After

source_file
comment "/// Multi basic block VJP, pullback not accepting branch tra"...
comment "// REQUIRES: executable_test"
comment "// RUN: %empty-directory(%t)"
comment "// RUN: %target-build-swift %s -o %t/none.out -Onone"
comment "// RUN: %target-build-swift %s -o %t/opt.out -O"
comment "// RUN: %target-codesign %t/none.out"
comment "// RUN: %target-codesign %t/opt.out"
comment "// RUN: %target-run %t/none.out"
comment "// RUN: %target-run %t/opt.out"
comment "// RUN: %target-swift-frontend -emit-sil %s -O -o %t/out.sil"
comment "// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK1"
comment "// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK2"
comment "// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK3"
comment "// RUN: cat %t/out.sil | %FileCheck %s --check-prefix=CHECK4"
import_declaration
import "import"
identifier
simple_identifier "DifferentiationUnittest"
import_declaration
import "import"
identifier
simple_identifier "StdlibUnittest"
property_declaration
value_binding_pattern
var "var"
pattern
simple_identifier "AutoDiffClosureSpecMultiBBNoBTETests"
= "="
call_expression
simple_identifier "TestSuite"
call_suffix
value_arguments
( "("
value_argument
line_string_literal
" "\""
line_str_text "AutoDiffClosureSpecMultiBBNoBTE"
" "\""
) ")"
typealias_declaration
typealias "typealias"
type_identifier "FloatArrayTan"
= "="
user_type
type_identifier "Array"
type_arguments
< "<"
user_type
type_identifier "Float"
> ">"
. "."
type_identifier "TangentVector"
call_expression
navigation_expression
simple_identifier "AutoDiffClosureSpecMultiBBNoBTETests"
navigation_suffix
. "."
simple_identifier "testWithLeakChecking"
call_suffix
value_arguments
( "("
value_argument
line_string_literal
" "\""
line_str_text "Test1"
" "\""
) ")"
lambda_literal
{ "{"
comment "// CHECK1-LABEL: {{^}}// reverse-mode derivative of sumFirst"...
comment "// CHECK1-NEXT: sil private @$s3outyycfU_27sumFirstThreeCon"...
comment "// CHECK1: %[[#E52:]] = function_ref @$s3outyycfU_27"...
comment "// CHECK1: %[[#E53:]] = partial_apply [callee_guaran"...
comment "// CHECK1: %[[#E55:]] = tuple (%[[#]], %[[#E53]])"
comment "// CHECK1: return %[[#E55]]"
comment "// CHECK1: } // end sil function '$s3outyycfU_27sumFir"...
comment "// CHECK1-NONE: {{^}}// pullback of sumFirstThreeConcatenat"...
comment "// CHECK1: {{^}}// specialized pullback of sumFirstThr"...
comment "// CHECK1: sil private {{.*}}@$s3outyycfU_27sumFirstTh"...
statements (+301 nodes collapsed)
} "}"
call_expression
navigation_expression
simple_identifier "AutoDiffClosureSpecMultiBBNoBTETests"
navigation_suffix
. "."
simple_identifier "testWithLeakChecking"
call_suffix
value_arguments
( "("
value_argument
line_string_literal
" "\""
line_str_text "Test2"
" "\""
) ")"
lambda_literal
{ "{"
comment "// CHECK2-LABEL: {{^}}// reverse-mode derivative of sumFirst"...
comment "// CHECK2-NEXT: sil private @$s3outyycfU0_27sumFirstThreeCo"...
comment "// CHECK2: %[[#E52:]] = function_ref @$s3outyycfU0_2"...
comment "// CHECK2: %[[#E53:]] = partial_apply [callee_guaran"...
comment "// CHECK2: %[[#E55:]] = tuple (%[[#]], %[[#E53]])"
comment "// CHECK2: return %[[#E55]]"
comment "// CHECK2: } // end sil function '$s3outyycfU0_27sumFi"...
comment "// CHECK2-NONE: {{^}}// pullback of sumFirstThreeConcatenat"...
comment "// CHECK2: {{^}}// specialized pullback of sumFirstThr"...
comment "// CHECK2: sil private {{.*}}@$s3outyycfU0_27sumFirstT"...
statements (+303 nodes collapsed)
} "}"
call_expression (+302 nodes collapsed)
call_expression (+407 nodes collapsed)
call_expression
simple_identifier "runAllTests"
call_suffix
value_arguments
( "("
) ")"