Skip to content

Commit d958521

Browse files
authored
Atomic mixed activity err (#2433)
* Atomic mixed activity err * fmt * fix * Fix * fix * fix * change * fmt
1 parent 2ce9ecd commit d958521

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

enzyme/Enzyme/ActivityAnalysis.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,6 +2440,18 @@ bool ActivityAnalyzer::isInstructionInactiveFromOrigin(TypeResults const &TR,
24402440
}
24412441
}
24422442

2443+
if (auto RMW = dyn_cast<AtomicRMWInst>(inst)) {
2444+
// if either src or dst is inactive, there cannot be a transfer of active
2445+
// values and thus the store is inactive
2446+
if (isConstantValue(TR, RMW->getPointerOperand())) {
2447+
if (EnzymePrintActivity)
2448+
llvm::errs()
2449+
<< " constant instruction as rmw pointer operand is inactive "
2450+
<< *inst << "\n";
2451+
return true;
2452+
}
2453+
}
2454+
24432455
if (!considerValue) {
24442456
if (auto IEI = dyn_cast<InsertElementInst>(inst)) {
24452457
if ((!TR.anyFloat(IEI->getOperand(0)) ||

0 commit comments

Comments
 (0)