File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816
816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817
817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818
818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819
- refs/heads/tensorflow: f537a9205d833236b7dd2a5c146c20a0c9bd437d
819
+ refs/heads/tensorflow: 21a0eee438e5117b014f225bc3b31967d10e3f2e
820
820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821
821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822
822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2
Original file line number Diff line number Diff line change @@ -4541,8 +4541,11 @@ class AdjointEmitter final : public SILInstructionVisitor<AdjointEmitter> {
4541
4541
break ;
4542
4542
}
4543
4543
case AdjointValueKind::Aggregate: {
4544
- llvm_unreachable (" Unhandled. Are you trying to differentiate a "
4545
- " memberwise initializer?" );
4544
+ // Note: All user-called initializations go through the calls to the
4545
+ // initializer, and synthesized initializers only have one level of struct
4546
+ // formation which will not result into any aggregate adjoint valeus.
4547
+ llvm_unreachable (" Aggregate adjoint values should not occur for `struct` "
4548
+ " instructions" );
4546
4549
}
4547
4550
}
4548
4551
}
Original file line number Diff line number Diff line change @@ -184,7 +184,8 @@ SimpleMathTests.test("StructMemberwiseInitializer") {
184
184
185
185
let 𝛁foo = pullback( at: Float ( 4 ) , in: { input -> Foo in
186
186
let foo = Foo ( stored: input)
187
- return foo + foo
187
+ let foo2 = foo + foo
188
+ return Foo ( stored: foo2. stored)
188
189
} ) ( Foo . TangentVector ( stored: 1 ) )
189
190
expectEqual ( 2 , 𝛁foo)
190
191
You can’t perform that action at this time.
0 commit comments