@@ -282,7 +282,8 @@ class JVPCloner::Implementation final
282282 assert (originalValue->getType ().isObject ());
283283 assert (newTangentValue.getType ().isObject ());
284284 assert (originalValue->getFunction () == original);
285- LLVM_DEBUG (getADDebugStream () << " Adding tangent for " << originalValue);
285+ LLVM_DEBUG (getADDebugStream ()
286+ << " Setting tangent value for " << originalValue);
286287 // The tangent value must be in the tangent space.
287288 assert (newTangentValue.getType () ==
288289 getRemappedTangentType (originalValue->getType ()));
@@ -1221,10 +1222,10 @@ class JVPCloner::Implementation final
12211222 for (auto indRes : ai->getIndirectSILResults ())
12221223 diffArgs.push_back (getTangentBuffer (bb, indRes));
12231224
1224- auto paramArgs = ai->getArgumentsWithoutIndirectResults ();
1225+ auto origArgs = ai->getArgumentsWithoutIndirectResults ();
12251226 // 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];
12281229 // If the argument is not active:
12291230 // - Skip the element, if it is not differentiable.
12301231 // - Otherwise, add a zero value to that location.
@@ -1565,8 +1566,8 @@ void JVPCloner::Implementation::prepareForDifferentialGeneration() {
15651566 // If original indirect result is non-varied, zero-initialize its tangent
15661567 // buffer.
15671568 if (!activityInfo.isVaried (origResult, getIndices ().parameters ))
1568- emitZeroIndirect (diffIndResult->getType ().getASTType (),
1569- diffIndResult, diffLoc);
1569+ emitZeroIndirect (diffIndResult->getType ().getASTType (), diffIndResult,
1570+ diffLoc);
15701571 continue ;
15711572 }
15721573 // Handle original non-wrt `inout` parameter.
@@ -1583,8 +1584,8 @@ void JVPCloner::Implementation::prepareForDifferentialGeneration() {
15831584 setTangentBuffer (origEntry, origResult, diffIndResult);
15841585 // Original `inout` parameters are initialized, so their tangent buffers
15851586 // must also be initialized.
1586- emitZeroIndirect (diffIndResult->getType ().getASTType (),
1587- diffIndResult, diffLoc);
1587+ emitZeroIndirect (diffIndResult->getType ().getASTType (), diffIndResult,
1588+ diffLoc);
15881589 }
15891590}
15901591
0 commit comments