Skip to content

Commit

Permalink
Fix batched shadow reverse runtime AA
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Dec 29, 2024
1 parent 29fe86b commit 5c8e319
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions enzyme/Enzyme/DiffeGradientUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,13 @@ void DiffeGradientUtils::addToInvertedPtrDiffe(
// the pointers and conditionally execute.
if ((!isa<AllocaInst>(basePtr) && !isAllocationCall(basePtr, TLI)) &&
runtimeActivity && !merge) {
Value *shadow = Builder2.CreateICmpNE(
lookupM(getNewFromOriginal(origptr), Builder2),
lookupM(invertPointerM(origptr, Builder2), Builder2));
Value *primal_val = lookupM(getNewFromOriginal(origptr), Builder2);
Value *shadow_val =
lookupM(invertPointerM(origptr, Builder2), Builder2);
if (getWidth() != 1) {
shadow_val = extractMeta(Builder2, shadow_val, 0);
}
Value *shadow = Builder2.CreateICmpNE(primal_val, shadow_val);

BasicBlock *current = Builder2.GetInsertBlock();
BasicBlock *conditional =
Expand Down

0 comments on commit 5c8e319

Please sign in to comment.