Skip to content

Commit

Permalink
Fix copyslice v2
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Dec 29, 2024
1 parent bdda0ce commit b06ff16
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions enzyme/Enzyme/ActivityAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ static inline void propagateArgumentInformation(
// Only the 0-th arg impacts activity
if (Name == "jl_genericmemory_copy_slice" ||
Name == "ijl_genericmemory_copy_slice") {
propagateFromOperand(CI.getArgOperand(1));
propagateFromOperand(CI.getArgOperand(0));
return;
}

Expand Down Expand Up @@ -1613,29 +1613,6 @@ bool ActivityAnalyzer::isConstantValue(TypeResults const &TR, Value *Val) {
return true;
}

if (funcName == "jl_genericmemory_copy_slice" ||
funcName == "ijl_genericmemory_copy_slice") {
if (directions == UP) {
if (isConstantValue(TR, op->getArgOperand(0))) {
InsertConstantValue(TR, Val);
return true;
}
} else {
if (UpHypothesis->isConstantValue(TR, op->getArgOperand(0))) {
InsertConstantValue(TR, Val);
insertConstantsFrom(TR, *UpHypothesis);
return true;
}
}
if (EnzymeEnableRecursiveHypotheses) {
ReEvaluateValueIfInactiveValue[op->getArgOperand(0)].insert(Val);
if (TmpOrig != Val) {
ReEvaluateValueIfInactiveValue[op->getArgOperand(0)].insert(
TmpOrig);
}
}
}

// If requesting empty unknown functions to be considered inactive,
// abide by those rules
if (called && EnzymeEmptyFnInactive && called->empty() &&
Expand Down

0 comments on commit b06ff16

Please sign in to comment.