@@ -8026,7 +8026,7 @@ class AdjointGenerator
8026
8026
return ;
8027
8027
}
8028
8028
}
8029
- if (funcName == " __fd_sincos_1" || funcName == " sincos " ) {
8029
+ if (funcName == " __fd_sincos_1" ) {
8030
8030
if (gutils->knownRecomputeHeuristic .find (orig) !=
8031
8031
gutils->knownRecomputeHeuristic .end ()) {
8032
8032
if (!gutils->knownRecomputeHeuristic [orig]) {
@@ -8057,13 +8057,13 @@ class AdjointGenerator
8057
8057
Intrinsic::getDeclaration (gutils->oldFunc ->getParent (),
8058
8058
Intrinsic::sin , tys),
8059
8059
args));
8060
- Value *dif0 = Builder2. CreateFSub (
8061
- Builder2.CreateFMul (Builder2. CreateExtractValue (vdiff, { 0 }),
8062
- dsin),
8063
- Builder2.CreateFMul (Builder2. CreateExtractValue (vdiff, { 1 }),
8064
- dcos));
8065
-
8066
- setDiffe (orig, dif0 , Builder2);
8060
+ Value *res = UndefValue::get (orig-> getType ());
8061
+ res = Builder2.CreateInsertValue (
8062
+ res, Builder2. CreateFMul (vdiff, dsin), { 0 });
8063
+ res = Builder2.CreateInsertValue (
8064
+ res, Builder2. CreateFNeg (Builder2. CreateFMul (vdiff, dcos)),
8065
+ { 1 });
8066
+ setDiffe (orig, res , Builder2);
8067
8067
return ;
8068
8068
}
8069
8069
case DerivativeMode::ReverseModeGradient:
0 commit comments