Polly 22.0.0git
PollyModulePass.cpp
Go to the documentation of this file.
1//===------ PollyModulePass.cpp - Polly module pass ----------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10#include "llvm/IR/Module.h"
11
12using namespace llvm;
13using namespace polly;
14
15PreservedAnalyses PollyModulePass::run(llvm::Module &M,
16 llvm::ModuleAnalysisManager &MAM) {
17 FunctionAnalysisManager &FAM =
18 MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
19
20 bool ModifiedAnyIR = false;
21 for (Function &F : M) {
22 bool LocalModifiedIR = runPollyPass(F, FAM, Opts);
23 ModifiedAnyIR |= LocalModifiedIR;
24 }
25
26 // Be conservative about preserved analyses, especially if parallel functions
27 // have been outlined.
28 return ModifiedAnyIR ? PreservedAnalyses::none() : PreservedAnalyses::all();
29}
PollyPassOptions Opts
llvm::PreservedAnalyses run(llvm::Module &M, llvm::ModuleAnalysisManager &)
bool runPollyPass(Function &F, llvm::FunctionAnalysisManager &FAM, PollyPassOptions Opts)
Run Polly and its phases on F.