Skip to content

Commit 1d269ca

Browse files
committed
Make same change in VJPEmitter::visitStructElementAddrInst.
1 parent 2373df2 commit 1d269ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/SILOptimizer/Mandatory/Differentiation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3305,7 +3305,8 @@ class VJPEmitter final
33053305
// This instruction is active. Determine the appropriate differentiation
33063306
// strategy, and use it.
33073307
auto *structDecl = seai->getStructDecl();
3308-
if (structDecl->getAttrs().hasAttribute<FieldwiseDifferentiableAttr>()) {
3308+
if (structDecl->getEffectiveAccess() <= AccessLevel::Internal ||
3309+
structDecl->getAttrs().hasAttribute<FieldwiseDifferentiableAttr>()) {
33093310
strategies[seai] = StructExtractDifferentiationStrategy::Fieldwise;
33103311
SILClonerWithScopes::visitStructElementAddrInst(seai);
33113312
return;

0 commit comments

Comments
 (0)