File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
SILOptimizer/Differentiation
test/AutoDiff/compiler_crashers_fixed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -407,6 +407,7 @@ static CanSILFunctionType getAutoDiffDifferentialType(
407
407
// result's convention is indirect.
408
408
if (tl.isAddressOnly () && !isIndirectFormalResult (origResConv)) {
409
409
switch (origResConv) {
410
+ case ResultConvention::Unowned:
410
411
case ResultConvention::Owned:
411
412
return ResultConvention::Indirect;
412
413
default :
Original file line number Diff line number Diff line change @@ -2431,7 +2431,7 @@ bool PullbackCloner::Implementation::runForSemanticMemberGetter() {
2431
2431
2432
2432
// Switch based on the base tangent struct's value category.
2433
2433
// TODO(TF-1255): Simplify using unified adjoint value data structure.
2434
- switch (tangentVectorSILTy. getCategory ( )) {
2434
+ switch (getTangentValueCategory (origSelf )) {
2435
2435
case SILValueCategory::Object: {
2436
2436
auto adjResult = getAdjointValue (origEntry, origResult);
2437
2437
switch (adjResult.getKind ()) {
@@ -2472,7 +2472,7 @@ bool PullbackCloner::Implementation::runForSemanticMemberGetter() {
2472
2472
if (field == tanField) {
2473
2473
// Switch based on the property's value category.
2474
2474
// TODO(TF-1255): Simplify using unified adjoint value data structure.
2475
- switch (origResult-> getType (). getCategory ( )) {
2475
+ switch (getTangentValueCategory (origResult )) {
2476
2476
case SILValueCategory::Object: {
2477
2477
auto adjResult = getAdjointValue (origEntry, origResult);
2478
2478
auto adjResultValue = materializeAdjointDirect (adjResult, pbLoc);
Original file line number Diff line number Diff line change
1
+ // RUN: %target-build-swift %s
2
+ // REQUIRES: asserts
3
+
4
+ // SR-13411: Semantic member getter pullback generation crash due to tangent value category mismatch
5
+
6
+ import _Differentiation
7
+
8
+ struct Dense : Differentiable {
9
+ @differentiable
10
+ var bias : Float ?
11
+ }
12
+
You can’t perform that action at this time.
0 commit comments