Skip to content

Commit 3ba2f94

Browse files
authored
LLVM codegen: register AA pipeline if LLVM is older than 14 (#6785)
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
1 parent 0f7d548 commit 3ba2f94

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/CodeGen_LLVM.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,13 @@ void CodeGen_LLVM::optimize_module() {
11191119
llvm::CGSCCAnalysisManager cgam;
11201120
llvm::ModuleAnalysisManager mam;
11211121

1122+
#if LLVM_VERSION < 140
1123+
// If building against LLVM older than 14, explicitly specify AA pipeline.
1124+
// Not needed with LLVM14 or later, already the default.
1125+
llvm::AAManager aa = pb.buildDefaultAAPipeline();
1126+
fam.registerPass([&] { return std::move(aa); });
1127+
#endif
1128+
11221129
// Register all the basic analyses with the managers.
11231130
pb.registerModuleAnalyses(mam);
11241131
pb.registerCGSCCAnalyses(cgam);

0 commit comments

Comments
 (0)