Skip to content

Commit

Permalink
Enable scope AA (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Jul 29, 2021
1 parent ff17a4e commit 6117bbd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions enzyme/Enzyme/FunctionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ void CanonicalizeLoops(Function *F, FunctionAnalysisManager &FAM) {
PA.preserve<PostDominatorTreeAnalysis>();
PA.preserve<TypeBasedAA>();
PA.preserve<BasicAA>();
PA.preserve<ScopedNoAliasAA>();
FAM.invalidate(*F, PA);
}

Expand All @@ -801,6 +802,8 @@ PreProcessCache::PreProcessCache() {
FAM.registerPass([] { return BasicAA(); });
MAM.registerPass([] { return GlobalsAA(); });

FAM.registerPass([] { return ScopedNoAliasAA(); });

// SCEVAA causes some breakage/segfaults
// disable for now, consider enabling in future
// FAM.registerPass([] { return SCEVAA(); });
Expand All @@ -813,6 +816,7 @@ PreProcessCache::PreProcessCache() {
AM.registerFunctionAnalysis<BasicAA>();
AM.registerFunctionAnalysis<TypeBasedAA>();
AM.registerModuleAnalysis<GlobalsAA>();
AM.registerFunctionAnalysis<ScopedNoAliasAA>();

// broken for different reasons
// AM.registerFunctionAnalysis<SCEVAA>();
Expand Down Expand Up @@ -956,6 +960,7 @@ Function *PreProcessCache::preprocessForClone(Function *F,
AAResults AA2(FAM.getResult<TargetLibraryAnalysis>(*NewF));
AA2.addAAResult(FAM.getResult<BasicAA>(*NewF));
AA2.addAAResult(FAM.getResult<TypeBasedAA>(*NewF));
AA2.addAAResult(FAM.getResult<ScopedNoAliasAA>(*NewF));

for (auto &g : NewF->getParent()->globals()) {
bool inF = false;
Expand Down Expand Up @@ -1282,6 +1287,7 @@ Function *PreProcessCache::preprocessForClone(Function *F,
PA.preserve<PostDominatorTreeAnalysis>();
PA.preserve<TypeBasedAA>();
PA.preserve<BasicAA>();
PA.preserve<ScopedNoAliasAA>();
PA.preserve<ScalarEvolutionAnalysis>();
#if LLVM_VERSION_MAJOR > 6
PA.preserve<PhiValuesAnalysis>();
Expand Down Expand Up @@ -1378,6 +1384,7 @@ Function *PreProcessCache::preprocessForClone(Function *F,
PA.preserve<PostDominatorTreeAnalysis>();
PA.preserve<TypeBasedAA>();
PA.preserve<BasicAA>();
PA.preserve<ScopedNoAliasAA>();
PA.preserve<ScalarEvolutionAnalysis>();
#if LLVM_VERSION_MAJOR > 6
PA.preserve<PhiValuesAnalysis>();
Expand Down

0 comments on commit 6117bbd

Please sign in to comment.