Skip to content

Commit

Permalink
LLVM codegen: register AA pipeline if LLVM is older than 14 (#6785)
Browse files Browse the repository at this point in the history
It's the default after https://reviews.llvm.org/D113210 / llvm/llvm-project@1331728,
but still needs to be done for earlier LLVM's.

Refs. #6783
Refs. #6718

Partially reverts #6718
  • Loading branch information
LebedevRI authored May 27, 2022
1 parent 0f7d548 commit 3ba2f94
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/CodeGen_LLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,13 @@ void CodeGen_LLVM::optimize_module() {
llvm::CGSCCAnalysisManager cgam;
llvm::ModuleAnalysisManager mam;

#if LLVM_VERSION < 140
// If building against LLVM older than 14, explicitly specify AA pipeline.
// Not needed with LLVM14 or later, already the default.
llvm::AAManager aa = pb.buildDefaultAAPipeline();
fam.registerPass([&] { return std::move(aa); });
#endif

// Register all the basic analyses with the managers.
pb.registerModuleAnalyses(mam);
pb.registerCGSCCAnalyses(cgam);
Expand Down

0 comments on commit 3ba2f94

Please sign in to comment.