Skip to content

Commit

Permalink
Fix combined temp cache for reverse (#2131)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Oct 22, 2024
1 parent 6185e17 commit c994307
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions enzyme/Enzyme/AdjointGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5489,8 +5489,11 @@ class AdjointGenerator : public llvm::InstVisitor<AdjointGenerator> {
It.setHeadBit(true);
BuilderZ.SetInsertPoint(It);
#endif
cachereplace = BuilderZ.CreatePHI(call.getType(), 1,
call.getName() + "_tmpcacheB");
if (Mode == DerivativeMode::ReverseModeCombined)
cachereplace = newCall;
else
cachereplace = BuilderZ.CreatePHI(call.getType(), 1,
call.getName() + "_tmpcacheB");
cachereplace = gutils->cacheForReverse(
BuilderZ, cachereplace,
getIndex(&call, CacheType::Self, BuilderZ));
Expand Down

0 comments on commit c994307

Please sign in to comment.