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 f9c01d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions enzyme/Enzyme/DiffeGradientUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,12 @@ 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 (gutils->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 f9c01d9

Please sign in to comment.