aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/PassManagerUtils.h
blob: 8d34c358efdbac9eb0fbd09f63664727ace1951c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//===-- llvm/Support/PassManagerUtils.h -------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file provides interface to pass manager utilities.
//
//===----------------------------------------------------------------------===//

namespace llvm {

class FunctionPassManager;
class PassManager;

/// AddOptimizationPasses - This routine adds optimization passes 
/// based on selected optimization level, OptLevel. This routine is
/// used by llvm-gcc and other tools.
///
/// OptLevel - Optimization Level
/// EnableIPO - Enables IPO passes. llvm-gcc enables this when
///             flag_unit_at_a_time is set.
/// InlinerSelection - 1 : Add function inliner.
///                  - 2 : Add AlwaysInliner.
/// OptLibCalls - Simplify lib calls, if set.
/// PruneEH - Add PruneEHPass, if set.
/// UnrollLoop - Unroll loops, if set.
void AddOptimizationPasses(FunctionPassManager &FPM, PassManager &MPM,
                           unsigned OptLevel, bool EnableIPO,
                           unsigned InlinerSelection, bool OptLibCalls,
                           bool PruneEH, bool UnrollLoop);

}