We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2373df2 commit 1d269caCopy full SHA for 1d269ca
lib/SILOptimizer/Mandatory/Differentiation.cpp
@@ -3305,7 +3305,8 @@ class VJPEmitter final
3305
// This instruction is active. Determine the appropriate differentiation
3306
// strategy, and use it.
3307
auto *structDecl = seai->getStructDecl();
3308
- if (structDecl->getAttrs().hasAttribute<FieldwiseDifferentiableAttr>()) {
+ if (structDecl->getEffectiveAccess() <= AccessLevel::Internal ||
3309
+ structDecl->getAttrs().hasAttribute<FieldwiseDifferentiableAttr>()) {
3310
strategies[seai] = StructExtractDifferentiationStrategy::Fieldwise;
3311
SILClonerWithScopes::visitStructElementAddrInst(seai);
3312
return;
0 commit comments