@@ -282,7 +282,8 @@ class JVPCloner::Implementation final
282
282
assert (originalValue->getType ().isObject ());
283
283
assert (newTangentValue.getType ().isObject ());
284
284
assert (originalValue->getFunction () == original);
285
- LLVM_DEBUG (getADDebugStream () << " Adding tangent for " << originalValue);
285
+ LLVM_DEBUG (getADDebugStream ()
286
+ << " Setting tangent value for " << originalValue);
286
287
// The tangent value must be in the tangent space.
287
288
assert (newTangentValue.getType () ==
288
289
getRemappedTangentType (originalValue->getType ()));
@@ -1221,10 +1222,10 @@ class JVPCloner::Implementation final
1221
1222
for (auto indRes : ai->getIndirectSILResults ())
1222
1223
diffArgs.push_back (getTangentBuffer (bb, indRes));
1223
1224
1224
- auto paramArgs = ai->getArgumentsWithoutIndirectResults ();
1225
+ auto origArgs = ai->getArgumentsWithoutIndirectResults ();
1225
1226
// Get the tangent value of the original arguments.
1226
- for (auto i : indices (paramArgs )) {
1227
- auto origArg = paramArgs [i];
1227
+ for (auto i : indices (origArgs )) {
1228
+ auto origArg = origArgs [i];
1228
1229
// If the argument is not active:
1229
1230
// - Skip the element, if it is not differentiable.
1230
1231
// - Otherwise, add a zero value to that location.
@@ -1565,8 +1566,8 @@ void JVPCloner::Implementation::prepareForDifferentialGeneration() {
1565
1566
// If original indirect result is non-varied, zero-initialize its tangent
1566
1567
// buffer.
1567
1568
if (!activityInfo.isVaried (origResult, getIndices ().parameters ))
1568
- emitZeroIndirect (diffIndResult->getType ().getASTType (),
1569
- diffIndResult, diffLoc);
1569
+ emitZeroIndirect (diffIndResult->getType ().getASTType (), diffIndResult,
1570
+ diffLoc);
1570
1571
continue ;
1571
1572
}
1572
1573
// Handle original non-wrt `inout` parameter.
@@ -1583,8 +1584,8 @@ void JVPCloner::Implementation::prepareForDifferentialGeneration() {
1583
1584
setTangentBuffer (origEntry, origResult, diffIndResult);
1584
1585
// Original `inout` parameters are initialized, so their tangent buffers
1585
1586
// must also be initialized.
1586
- emitZeroIndirect (diffIndResult->getType ().getASTType (),
1587
- diffIndResult, diffLoc);
1587
+ emitZeroIndirect (diffIndResult->getType ().getASTType (), diffIndResult,
1588
+ diffLoc);
1588
1589
}
1589
1590
}
1590
1591
0 commit comments