File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
enzyme/tools/enzyme-tblgen Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -1166,9 +1166,27 @@ void handleUse(
11661166 bool usesShadow = Def->getValueAsBit (" usesShadow" );
11671167 bool usesCustom = Def->getValueAsBit (" usesCustom" );
11681168
1169- // We don't handle any custom primal/shadow
1170- (void )usesCustom;
1171- assert (!usesCustom);
1169+ // This only concerns instances of StaticSelect for now
1170+ if (usesCustom) {
1171+ auto numArgs = resultTree->getNumArgs ();
1172+
1173+ for (int i = numArgs == 3 ; i < numArgs; ++i) {
1174+ std::string foundPrimalUse2 = " " ;
1175+ std::string foundShadowUse2 = " " ;
1176+
1177+ bool foundDiffRet2 = false ;
1178+
1179+ auto name = resultTree->getArgNameStr (i);
1180+ auto arg = resultTree->getArg (i);
1181+ auto arg2 = dyn_cast<DagInit>(arg);
1182+ handleUse (root, arg2, name.size () ? foundPrimalUse2 : foundPrimalUse,
1183+ name.size () ? foundShadowUse2 : foundShadowUse,
1184+ name.size () ? foundDiffRet2 : foundDiffRet,
1185+ usesPrimal ? precondition : " " , tree, varNameToCondition);
1186+ }
1187+
1188+ return ;
1189+ }
11721190
11731191 for (auto argEn : llvm::enumerate (resultTree->getArgs ())) {
11741192 auto name = resultTree->getArgNameStr (argEn.index ());
You can’t perform that action at this time.
0 commit comments