Skip to content

Commit

Permalink
Recompute of constant global variables
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed May 17, 2021
1 parent b3685b5 commit 777c96e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion enzyme/Enzyme/ActivityAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ bool ActivityAnalyzer::isConstantValue(TypeResults &TR, Value *Val) {
<< " potentiallyActiveLoad=" << potentiallyActiveLoad
<< " potentialStore=" << potentialStore << "\n";
if (potentiallyActiveLoad && potentialStore) {
activeLoadAndStore:;
activeLoadAndStore:;
insertAllFrom(TR, *Hypothesis, Val);
// TODO have insertall dependence on this
if (TmpOrig != Val)
Expand Down
4 changes: 2 additions & 2 deletions enzyme/Enzyme/EnzymeLogic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ struct CacheAnalysis {
}
} else if (isa<AllocaInst>(obj)) {
// No change to modref if alloca
} else if (isa<GlobalVariable>(obj)) {
} else if (auto GV = dyn_cast<GlobalVariable>(obj)) {
// In the absense of more fine-grained global info, assume object is
// written to in a subseqent call unless this is "topLevel";
if (!topLevel) {
if (!topLevel && !GV->isConstant()) {
mustcache = true;
}
} else if (auto sli = dyn_cast<LoadInst>(obj)) {
Expand Down

0 comments on commit 777c96e

Please sign in to comment.