Skip to content

Commit 2d24f11

Browse files
committed
---
yaml --- r: 311283 b: refs/heads/tensorflow-merge c: 7fff717 h: refs/heads/master i: 311281: ccb7b45 311279: 3a1d5e0
1 parent 8e30a0e commit 2d24f11

File tree

16 files changed

+155
-172
lines changed

16 files changed

+155
-172
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ refs/heads/chase-my-tail: 8bb91443a9e81bbfac92a2621a0af887a1da8dbf
13791379
refs/heads/consider-outer-alternatives: 708bac749ec60a22a79e2eefbe734f9488a7370d
13801380
refs/heads/revert-25740-oops-i-linked-it-again: fdd41aeb682fc488572bdc1cf71b2ff6997ba576
13811381
refs/heads/swift-5.1-branch-06-12-2019: e63b7b2d3b93c48232d386099d0ec525d21d8f8d
1382-
refs/heads/tensorflow-merge: 205185f2817c57c040193ccb72987f4f0dcbca4d
1382+
refs/heads/tensorflow-merge: 7fff717b2f36012306ac573761e6c27a9e5fb356
13831383
refs/heads/update-checkout-sha-info: 5832743c5c2a842976c42a508a4c6dcceefb0aef
13841384
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-12-a: 228f0448d9bb909aacbba4afcb7c600a405d15da
13851385
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-14-a: 922861a77b5fc2bf46bc917da70ceb15eef76836

branches/tensorflow-merge/lib/IRGen/GenBuiltin.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,8 @@ if (Builtin.ID == BuiltinValueKind::id) { \
10041004
// OpaqueValue *swift_autoDiffCreateTape(Metadata *type);
10051005
if (Builtin.ID == BuiltinValueKind::AutoDiffCreateTape) {
10061006
auto valueTy =
1007-
getLoweredTypeAndTypeInfo(IGF.IGM, substitutions[0].getReplacement());
1007+
getLoweredTypeAndTypeInfo(
1008+
IGF.IGM, substitutions.getReplacementTypes().front());
10081009
auto *metadata =
10091010
IGF.emitTypeMetadataRef(valueTy.first.getSwiftRValueType());
10101011
out.add(IGF.Builder.CreateCall(IGF.IGM.getAutoDiffCreateTapeFn(),
@@ -1044,8 +1045,8 @@ if (Builtin.ID == BuiltinValueKind::id) { \
10441045
// `id` argument may be discarded. It is used as a marker in SIL.
10451046
(void)args.claimAll();
10461047

1047-
auto valueTy = getLoweredTypeAndTypeInfo(IGF.IGM,
1048-
substitutions[0].getReplacement());
1048+
auto valueTy = getLoweredTypeAndTypeInfo(
1049+
IGF.IGM, substitutions.getReplacementTypes().front());
10491050
auto pointerTy = valueTy.second.getStorageType()->getPointerTo();
10501051

10511052
// Pop alloca from tape and cast to pointer type.

branches/tensorflow-merge/lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ bool Parser::parseNewDeclAttribute(DeclAttributes &Attributes, SourceLoc AtLoc,
15851585

15861586
/// SWIFT_ENABLE_TENSORFLOW
15871587
case DAK_Differentiable: {
1588-
ParserResult<DifferentiableAttr> Attr = parseDifferentiableAttribute(AtLoc, Loc);
1588+
auto Attr = parseDifferentiableAttribute(AtLoc, Loc);
15891589
if (Attr.isNonNull()) {
15901590
Attributes.add(Attr.get());
15911591
}

branches/tensorflow-merge/lib/ParseSIL/ParseSIL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ static bool parseSymbolicValue(SymbolicValue &value, SILParser &SP,
10061006
SILType temp;
10071007
if (SP.parseSILType(temp))
10081008
return true;
1009-
auto metatype = CanMetatypeType::get(temp.getSwiftRValueType());
1009+
auto metatype = CanMetatypeType::get(temp.getASTType());
10101010
value = SymbolicValue::getMetatype(metatype);
10111011
return false;
10121012
}
@@ -2873,15 +2873,15 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
28732873
P.Context.TheBuiltinModule->lookupMember(foundBuiltins,
28742874
P.Context.TheBuiltinModule, Id,
28752875
Identifier());
2876-
2876+
// SWIFT_ENABLE_TENSORFLOW
2877+
SubstitutionMap subMap;
28772878
if (!foundBuiltins.empty()) {
28782879
assert(foundBuiltins.size() == 1 && "ambiguous builtin name?!");
28792880

28802881
auto *builtinFunc = cast<FuncDecl>(foundBuiltins[0]);
28812882
GenericEnvironment *genericEnv = builtinFunc->getGenericEnvironment();
28822883

28832884
SmallVector<ParsedSubstitution, 4> parsedSubs;
2884-
SubstitutionMap subMap;
28852885
if (parseSubstitutions(parsedSubs))
28862886
return true;
28872887

branches/tensorflow-merge/lib/SIL/SILVerifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,14 +1469,14 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
14691469
void checkAutoDiffBuiltinInst(BuiltinInst *BI) {
14701470
auto &ctx = M->getASTContext();
14711471
auto id = BI->getBuiltinInfo().ID;
1472-
require(BI->getSubstitutions().size() == 1,
1472+
require(BI->getSubstitutions().getReplacementTypes().size() == 1,
14731473
"autodiff builtin should have a single type parameter");
14741474

14751475
auto name = getBuiltinName(id);
14761476
auto resultErrorMsg = "unexpected result type for '" + name + "'";
14771477
auto operandErrorMsg = "unexpected operand type for '" + name + "'";
14781478

1479-
auto canGenericParam = BI->getSubstitutions()[0].getReplacement()
1479+
auto canGenericParam = BI->getSubstitutions().getReplacementTypes()[0]
14801480
->getCanonicalType();
14811481
auto tapeType = SILType::getPrimitiveObjectType(
14821482
BoundGenericType::get(ctx.get_AutoDiffTapeDecl(), Type(), canGenericParam)

branches/tensorflow-merge/lib/SILOptimizer/Mandatory/TFConstExpr.cpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ConstExprLimit("constexpr-limit", llvm::cl::init(256),
3131
" constexpr function"));
3232

3333
static llvm::Optional<SymbolicValue>
34-
evaluateAndCacheCall(SILFunction &fn, SubstitutionList substitutions,
34+
evaluateAndCacheCall(SILFunction &fn, SubstitutionMap substitutionMap,
3535
ArrayRef<SymbolicValue> arguments,
3636
SmallVectorImpl<SymbolicValue> &results,
3737
unsigned &numInstEvaluated,
@@ -58,9 +58,6 @@ namespace {
5858

5959
/// If we have a function being analyzed, this is the substitution list for
6060
/// the call to it.
61-
SubstitutionList substitutions;
62-
63-
/// This is a mapping of substitutions.
6461
SubstitutionMap substitutionMap;
6562

6663
/// This keeps track of the number of instructions we've evaluated. If this
@@ -73,17 +70,10 @@ namespace {
7370

7471
public:
7572
ConstExprFunctionCache(ConstExprEvaluator &evaluator, SILFunction *fn,
76-
SubstitutionList substitutions,
73+
SubstitutionMap substitutionMap,
7774
unsigned &numInstEvaluated)
78-
: evaluator(evaluator), fn(fn), substitutions(substitutions),
79-
numInstEvaluated(numInstEvaluated) {
80-
81-
if (fn && !substitutions.empty()) {
82-
auto signature = fn->getLoweredFunctionType()->getGenericSignature();
83-
if (signature)
84-
substitutionMap = signature->getSubstitutionMap(substitutions);
85-
}
86-
}
75+
: evaluator(evaluator), fn(fn), substitutionMap(substitutionMap),
76+
numInstEvaluated(numInstEvaluated) {}
8777

8878
void setValue(SILValue value, SymbolicValue symVal) {
8979
calculatedValues.insert({ value, symVal });
@@ -617,7 +607,7 @@ ConstExprFunctionCache::computeCallResult(ApplyInst *apply) {
617607
// the call.
618608
SmallVector<SymbolicValue, 4> results;
619609
auto callResult =
620-
evaluateAndCacheCall(*callee, apply->getSubstitutions(),
610+
evaluateAndCacheCall(*callee, apply->getSubstitutionMap(),
621611
paramConstants, results, numInstEvaluated, evaluator);
622612
if (callResult.hasValue())
623613
return callResult.getValue();
@@ -869,13 +859,13 @@ ConstExprFunctionCache::evaluateFlowSensitive(SILInstruction *inst) {
869859
/// expression, returning None and filling in `results` on success, or
870860
/// returning an 'Unknown' SymbolicValue on failure carrying the error.
871861
static llvm::Optional<SymbolicValue>
872-
evaluateAndCacheCall(SILFunction &fn, SubstitutionList substitutions,
862+
evaluateAndCacheCall(SILFunction &fn, SubstitutionMap substitutionMap,
873863
ArrayRef<SymbolicValue> arguments,
874864
SmallVectorImpl<SymbolicValue> &results,
875865
unsigned &numInstEvaluated,
876866
ConstExprEvaluator &evaluator) {
877867
assert(!fn.isExternalDeclaration() && "Can't analyze bodyless function");
878-
ConstExprFunctionCache cache(evaluator, &fn, substitutions,
868+
ConstExprFunctionCache cache(evaluator, &fn, substitutionMap,
879869
numInstEvaluated);
880870

881871
// TODO: implement caching.

branches/tensorflow-merge/lib/SILOptimizer/Mandatory/TFDeabstraction.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ static BuiltinInst *simplifyOperands(BuiltinInst *inst, TFDeabstraction &TFDA) {
369369
// parameter.
370370
auto canSimplifyOperand = [&](SILType type) -> bool {
371371
return isLoadableAddressType(type) ||
372-
getPrimitiveStructField(type.getSwiftRValueType()) != nullptr;
372+
getPrimitiveStructField(type.getASTType()) != nullptr;
373373
};
374374

375375
// If we don't have to change any operands, don't rewrite the builtin.
@@ -408,7 +408,7 @@ static BuiltinInst *simplifyOperands(BuiltinInst *inst, TFDeabstraction &TFDA) {
408408

409409
// If this is a struct value, emit struct extraction instruction(s).
410410
while (auto fieldDecl = getPrimitiveStructField(
411-
operand->getType().getSwiftRValueType())) {
411+
operand->getType().getASTType())) {
412412
auto extract = B.createStructExtract(inst->getLoc(), operand, fieldDecl);
413413
extract->setDebugLocation(inst->getDebugLocation());
414414
operand = extract;
@@ -421,7 +421,7 @@ static BuiltinInst *simplifyOperands(BuiltinInst *inst, TFDeabstraction &TFDA) {
421421
// the old one.
422422
auto *newInst =
423423
B.createBuiltin(inst->getLoc(), inst->getName(),
424-
inst->getType(), /*no substitions*/{}, operands);
424+
inst->getType(), SubstitutionMap(), operands);
425425
newInst->setDebugLocation(inst->getDebugLocation());
426426

427427
// Replace the old with the new and delete the old instruction.
@@ -1544,7 +1544,7 @@ static void expandArrayConstant(ArrayRef<SymbolicValue> arrayElements,
15441544
name += SILTensorOpInfo::getOperandClassSuffix(attrKind);
15451545

15461546
auto metatypeType =
1547-
MetatypeType::get(arrayEltType.getSwiftRValueType(),
1547+
MetatypeType::get(arrayEltType.getASTType(),
15481548
MetatypeRepresentation::Thin)
15491549
->getCanonicalType();
15501550
operands.push_back(B.createMetatype(forInst->getLoc(),
@@ -1644,7 +1644,7 @@ tryToPromoteTensorFromScalars(ApplyInst *inst,
16441644

16451645
if (!errorInfo.empty()) {
16461646
auto loc = getUserSourceLocation(inst);
1647-
diagnose(inst->getType().getSwiftRValueType()->getASTContext(),
1647+
diagnose(inst->getType().getASTType()->getASTContext(),
16481648
loc.getSourceLoc(), diag::tf_op_misuse, errorInfo)
16491649
.highlight(loc.getSourceRange());
16501650
return nullptr;
@@ -1664,7 +1664,7 @@ tryToPromoteTensorFromScalars(ApplyInst *inst,
16641664
auto newInst =
16651665
B.createBuiltin(inst->getLoc(),
16661666
B.getASTContext().getIdentifier(name),
1667-
inst->getType(), /*no substitions*/{},
1667+
inst->getType(), SubstitutionMap(),
16681668
operands);
16691669
newInst->setDebugLocation(inst->getDebugLocation());
16701670
inst->replaceAllUsesPairwiseWith(newInst);
@@ -1751,7 +1751,7 @@ tryToPromoteTensorFromScalars1D(ApplyInst *inst,
17511751
auto newInst =
17521752
B.createBuiltin(inst->getLoc(),
17531753
B.getASTContext().getIdentifier(name),
1754-
inst->getType(), /*no substitions*/{},
1754+
inst->getType(), SubstitutionMap(),
17551755
operands);
17561756
newInst->setDebugLocation(inst->getDebugLocation());
17571757
inst->replaceAllUsesPairwiseWith(newInst);

branches/tensorflow-merge/lib/SILOptimizer/Mandatory/TFDevicePartition.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void DevicePartitionCloner::visitTFOpInst(BuiltinInst *inst,
191191

192192
auto newName = B.getASTContext().getIdentifier(tfopInfo.builtinName);
193193
auto result = B.createBuiltin(loc, newName, inst->getType(),
194-
/*substitutionlist*/ {}, args);
194+
/*no substitutions*/ {}, args);
195195
ValueMap[inst] = result;
196196
}
197197

@@ -217,11 +217,10 @@ void DevicePartitionCloner::addD2DSend(BuiltinInst *inst, int transferId,
217217
auto voidTy = B.getModule().Types.getEmptyTupleType();
218218
auto valueToSend = remapValue(inst->getOperand(0));
219219
auto destDeviceStr = getDeviceString(destDevice);
220-
auto valueTy = inst->getResults()[0]->getType();
221220
auto destDeviceAttr = B.createStringLiteral(
222221
loc, StringRef(destDeviceStr), StringLiteralInst::Encoding::UTF8);
223222
B.createBuiltin(loc, ctx.getIdentifier(newInstName), voidTy,
224-
Substitution(valueTy.getSwiftRValueType(), {}),
223+
inst->getSubstitutions(),
225224
{valueToSend, transferIdAttr, destDeviceAttr, deviceAttr});
226225
// Do not update ValueMap since Send does not produce a value.
227226
}
@@ -250,7 +249,7 @@ void DevicePartitionCloner::addD2DRecv(BuiltinInst *inst, int transferId,
250249
auto valueTy = inst->getResults()[0]->getType();
251250
auto newValue =
252251
B.createBuiltin(inst->getLoc(), ctx.getIdentifier(newInstName), valueTy,
253-
Substitution(valueTy.getSwiftRValueType(), {}),
252+
inst->getSubstitutions(),
254253
{transferIdAttr, srcDeviceAttr, deviceAttr});
255254
auto valueToRecv = inst->getResults()[0];
256255
ValueMap[valueToRecv] = newValue;
@@ -660,9 +659,11 @@ class DevicePartitionerImpl
660659
StringLiteralInst::Encoding::UTF8);
661660
markInstForAllDevices(destDeviceAttr);
662661

662+
// At this point, the operand must have been produced by a `builtin` inst.
663+
auto builtinInst = cast<BuiltinInst>(operandInst);
663664
auto transferInst = B.createBuiltin(
664665
loc, ctx.getIdentifier(newInstName), opValue->getType(),
665-
Substitution(opValue->getType().getSwiftRValueType(), {}),
666+
builtinInst->getSubstitutions(),
666667
{opValue, transferIdAttr, srcDeviceAttr, destDeviceAttr});
667668
transferInstsByDestDevice[lookupKey] = transferInst;
668669
markInstForDevice(operandDeviceType, transferInst);

branches/tensorflow-merge/lib/SILOptimizer/Mandatory/TFDifferentiation.cpp

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,8 @@ class AdjointGen {
653653
void AdjointGen::accumulateAdjoint(SILValue oldAdjoint, SILValue newAdjoint,
654654
SILValue resultBuffer, SILBuilder &builder,
655655
SILLocation loc) const {
656-
auto adjointTy = oldAdjoint->getType().getSwiftRValueType();
657-
assert(adjointTy->isEqual(oldAdjoint->getType().getSwiftRValueType()) &&
656+
auto adjointTy = oldAdjoint->getType().getASTType();
657+
assert(adjointTy->isEqual(oldAdjoint->getType().getASTType()) &&
658658
"Adjoints must have equal types!");
659659
auto adjointTyDecl = adjointTy->getAnyNominal();
660660
// If the type conforms to `VectorNumeric`, then combine them using
@@ -684,19 +684,15 @@ void AdjointGen::accumulateAdjoint(SILValue oldAdjoint, SILValue newAdjoint,
684684
// %0 = witness_method @+
685685
auto witnessMethod = builder.createWitnessMethod(loc, adjointTy, confRef,
686686
declRef, silFnTy);
687-
auto subMap =
688-
adjointTy->getMemberSubstitutionMap(context.getModule().getSwiftModule(),
689-
combinerFuncDecl);
690-
SmallVector<Substitution, 1> subs;
691-
confRef.getConcrete()->getGenericSignature()->getSubstitutions(subMap, subs);
687+
auto subMap = SubstitutionMap::getProtocolSubstitutions(proto, adjointTy, confRef);
692688
// %1 = metatype $T.Type
693689
auto metatypeType = MetatypeType::get(adjointTy)->getCanonicalType();
694690
auto metatypeSILType = SILType::getPrimitiveObjectType(metatypeType);
695691
auto metatype = builder.createMetatype(loc, metatypeSILType);
696692
// %2 = apply $0(%result, %new, %old, %1)
697-
builder.createApply(loc, witnessMethod, subs,
693+
builder.createApply(loc, witnessMethod, subMap,
698694
{ resultBuffer, newAdjoint, oldAdjoint, metatype },
699-
/*isNonThrowing*/false);
695+
/*isNonThrowing*/ false);
700696
}
701697

702698
SILFunction *
@@ -996,11 +992,9 @@ static void convertFromIntegerLiteral(intmax_t value,
996992
// %3 = witness_method ...
997993
auto initBILFn = builder.createWitnessMethod(loc, intLitTy, ebilConfRef,
998994
initBILDeclRef, initBILType);
999-
// Get substitutions.
1000-
auto intLitSubMap =
1001-
intLitTy->getMemberSubstitutionMap(astCtx.getStdlibModule(), initBILDecl);
1002-
SmallVector<Substitution, 1> initBILSubs;
1003-
ebilProto->getGenericSignature()->getSubstitutions(intLitSubMap, initBILSubs);
995+
// Get substitution map.
996+
auto initBILSubMap =
997+
SubstitutionMap::getProtocolSubstitutions(ebilProto, intLitTy, ebilConfRef);
1004998
// Allocate result buffer.
1005999
// %intLitBuf = alloc_stack $IntegerLiteralType
10061000
auto *intLitBuf =
@@ -1010,7 +1004,7 @@ static void convertFromIntegerLiteral(intmax_t value,
10101004
builder.createDeallocStack(loc, intLitBuf);
10111005
};
10121006
// %4 = apply %3 <...>(%intLitBuf, %1, %2)
1013-
builder.createApply(loc, initBILFn, astCtx.AllocateCopy(initBILSubs),
1007+
builder.createApply(loc, initBILFn, initBILSubMap,
10141008
{ intLitBuf, builtinInt, intLitMetatype },
10151009
/*isNonThrowing*/ false);
10161010

@@ -1037,14 +1031,11 @@ static void convertFromIntegerLiteral(intmax_t value,
10371031
// %6 = witness_method ...
10381032
auto initILFn = builder.createWitnessMethod(loc, targetTy, eilConfRef,
10391033
initILDeclRef, initILType);
1040-
// Get substitutions.
1041-
auto targetSubMap =
1042-
targetTy->getMemberSubstitutionMap(targetTypeDecl->getModuleContext(),
1043-
initILDecl);
1044-
SmallVector<Substitution, 1> initILSubs;
1045-
eilProto->getGenericSignature()->getSubstitutions(targetSubMap, initILSubs);
1034+
// Get substitution map.
1035+
auto initILSubMap =
1036+
SubstitutionMap::getProtocolSubstitutions(eilProto, targetTy, eilConf);
10461037
// %7 = apply %6 <...>(%resultBuf, %intLitBuf, %5)
1047-
builder.createApply(loc, initILFn, initILSubs,
1038+
builder.createApply(loc, initILFn, initILSubMap,
10481039
{ resultBuf, intLitBuf, targetMetatype },
10491040
/*isNonThrowing*/ false);
10501041
}
@@ -1117,13 +1108,10 @@ static void convertToIndirectSeed(intmax_t value, CanType type,
11171108
// $4 = witness_method ...
11181109
auto initFnRef =
11191110
builder.createWitnessMethod(loc, type, confRef, reqrRef, silInitTy);
1120-
auto initSubMap =
1121-
type->getMemberSubstitutionMap(module.getSwiftModule(), reqr,
1122-
vecNumProto->getGenericEnvironment());
1123-
SmallVector<Substitution, 1> subs;
1124-
vecNumProto->getGenericSignature()->getSubstitutions(initSubMap, subs);
1111+
auto subMap =
1112+
SubstitutionMap::getProtocolSubstitutions(vecNumProto, type, confRef);
11251113
// %5 = apply %4(%3, %2, %1)
1126-
builder.createApply(loc, initFnRef, astCtx.AllocateCopy(subs),
1114+
builder.createApply(loc, initFnRef, subMap,
11271115
{ seedBuf, scalarValBuf, metatype },
11281116
/*isNonThrowing*/ false);
11291117
}
@@ -1255,11 +1243,11 @@ static SILFunction *getOrCreateGradient(
12551243
// Call the canonical gradient function.
12561244
// %0 = function_ref ...
12571245
auto *canGradFnRef = builder.createFunctionRef(loc, canonicalGrad);
1258-
SubstitutionList substList;
1246+
SubstitutionMap subMap;
12591247
if (auto *genEnv = gradFn->getGenericEnvironment())
1260-
substList = genEnv->getForwardingSubstitutions();
1248+
subMap = genEnv->getForwardingSubstitutionMap();
12611249
// %1 = apply %0(...)
1262-
auto *resultAndGrad = builder.createApply(loc, canGradFnRef, substList,
1250+
auto *resultAndGrad = builder.createApply(loc, canGradFnRef, subMap,
12631251
args, /*isNonThrowing*/ false);
12641252
// Clean up stack allocations made by seed passing when seed is addr-only.
12651253
for (auto alloc : stackAllocsToCleanUp)
@@ -1343,9 +1331,9 @@ static void fillCanonicalGradient(SILFunction &canGrad,
13431331
// %0 = function_ref @primal
13441332
auto *primalRef = builder.createFunctionRef(loc, primal);
13451333
// %1 = apply %0(...)
1346-
auto *primalApply = builder.createApply(loc, primalRef,
1347-
canGrad.getForwardingSubstitutions(),
1348-
primalArgs, /*isNonThrowing*/ false);
1334+
auto *primalApply = builder.createApply(
1335+
loc, primalRef, canGrad.getForwardingSubstitutionMap(),
1336+
primalArgs, /*isNonThrowing*/ false);
13491337
// Collect the primal's direct results.
13501338
SmallVector<SILValue, 8> primalResults;
13511339
if (primalConv.getNumDirectSILResults() == 1)
@@ -1380,7 +1368,7 @@ static void fillCanonicalGradient(SILFunction &canGrad,
13801368
auto *adjRef = builder.createFunctionRef(loc, adjoint);
13811369
// %3 = apply %2(...)
13821370
auto *adjApply = builder.createApply(loc, adjRef,
1383-
canGrad.getForwardingSubstitutions(),
1371+
canGrad.getForwardingSubstitutionMap(),
13841372
adjointArgs, /*isNonThrowing*/ false);
13851373
// Clean up stack allocations.
13861374
for (auto val : reversed(stackAllocsToCleanUp))

0 commit comments

Comments
 (0)