Skip to content

Commit c28d9cd

Browse files
authored
[AutoDiff] NFC: fix typos. (swiftlang#33002)
1 parent acf72bd commit c28d9cd

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lib/SILOptimizer/Mandatory/Differentiation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,8 @@ static SILFunction *createEmptyVJP(ADContext &context, SILFunction *original,
771771
witness->getConfig()))
772772
.str();
773773
CanGenericSignature vjpCanGenSig;
774-
if (auto jvpGenSig = witness->getDerivativeGenericSignature())
775-
vjpCanGenSig = jvpGenSig->getCanonicalSignature();
774+
if (auto vjpGenSig = witness->getDerivativeGenericSignature())
775+
vjpCanGenSig = vjpGenSig->getCanonicalSignature();
776776
GenericEnvironment *vjpGenericEnv = nullptr;
777777
if (vjpCanGenSig && !vjpCanGenSig->areAllParamsConcrete())
778778
vjpGenericEnv = vjpCanGenSig->getGenericEnvironment();

stdlib/public/Differentiation/SIMDDifferentiation.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ where
413413
}
414414

415415
// FIXME(TF-1103): Derivative registration does not yet support
416-
// `@_alwaysEmitIntoClient` original functions.
416+
// `@_alwaysEmitIntoClient` original functions like `SIMD.sum()`.
417417
/*
418418
extension SIMD
419419
where

test/AutoDiff/stdlib/simd.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ SIMDTests.test("Generics") {
271271
expectEqual((3, SIMD3<Double>(-1, -1, -1)), pb3(g))
272272

273273
// SIMDType * Scalar
274-
func testMultipication<Scalar, SIMDType: SIMD>(lhs: SIMDType, rhs: Scalar)
274+
func testMultiplication<Scalar, SIMDType: SIMD>(lhs: SIMDType, rhs: Scalar)
275275
-> SIMDType
276276
where SIMDType.Scalar == Scalar,
277277
SIMDType : Differentiable,
@@ -281,13 +281,14 @@ SIMDTests.test("Generics") {
281281
return lhs * rhs
282282
}
283283
func simd3Multiply(lhs: SIMD3<Double>, rhs: Double) -> SIMD3<Double> {
284-
return testMultipication(lhs: lhs, rhs: rhs)
284+
return testMultiplication(lhs: lhs, rhs: rhs)
285285
}
286286
let (val4, pb4) = valueWithPullback(at: a, 5, in: simd3Multiply)
287287
expectEqual(SIMD3<Double>(5, 10, 15), val4)
288288
expectEqual((SIMD3<Double>(5, 5, 5), 6), pb4(g))
289289

290290
// FIXME(TF-1103): Derivative registration does not yet support
291+
// `@_alwaysEmitIntoClient` original functions like `SIMD.sum()`.
291292
/*
292293
func testSum<Scalar, SIMDType: SIMD>(x: SIMDType) -> Scalar
293294
where SIMDType.Scalar == Scalar,

0 commit comments

Comments
 (0)