From 9476d4543f4336a66308e55f722b0b0b2bd69dd2 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 16 Mar 2023 23:46:14 -0700 Subject: Fix Phi simplification bug. (#2710) * Fix Phi simplification bug. * Fix up. * Fix. * Fix. * Fix. * Fix. * Fix. * Fix test. * Fix test. --------- Co-authored-by: Yong He --- source/slang/slang-check-decl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-check-decl.cpp') diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index ea8bec2bb..2613e6430 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -3324,6 +3324,7 @@ namespace Slang { VarDecl* indexVar = nullptr; auto forStmt = synth.emitFor(synth.emitIntConst(0), synth.emitGetArrayLengthExpr(leftValue), indexVar); + addModifier(forStmt, synth.getBuilder()->create()); auto innerLeft = synth.emitIndexExpr(leftValue, synth.emitVarExpr(indexVar)); for (auto& arg : args) { @@ -3358,6 +3359,7 @@ namespace Slang // We synthesize a memberwise dispatch to compute each field of `TResult`, // resulting an implementation of the form: // ``` + // [BackwardDifferentiable] // static TResult requiredMethod(TParam1 p0, TParam2 p1, ...) // { // TResult result; @@ -3389,6 +3391,9 @@ namespace Slang ThisExpr* synThis = nullptr; auto synFunc = synthesizeMethodSignatureForRequirementWitness( context, requirementDeclRef.as(), synArgs, synThis); + + addModifier(synFunc, m_astBuilder->create()); + synFunc->parentDecl = context->parentDecl; synth.pushContainerScope(synFunc); auto blockStmt = m_astBuilder->create(); -- cgit v1.2.3