My Project
OptUtils.h
Go to the documentation of this file.
1 //===- OptUtils.h - MLIR Execution Engine opt pass utilities ----*- C++ -*-===//
2 //
3 // Part of the MLIR 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 //
9 // This file declares the utility functions to trigger LLVM optimizations from
10 // MLIR Execution Engine.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MLIR_EXECUTIONENGINE_OPTUTILS_H_
15 #define MLIR_EXECUTIONENGINE_OPTUTILS_H_
16 
17 #include "llvm/Pass.h"
18 
19 #include <functional>
20 #include <string>
21 
22 namespace llvm {
23 class Module;
24 class Error;
25 class TargetMachine;
26 } // namespace llvm
27 
28 namespace mlir {
29 
33 
39 std::function<llvm::Error(llvm::Module *)>
40 makeOptimizingTransformer(unsigned optLevel, unsigned sizeLevel,
41  llvm::TargetMachine *targetMachine);
42 
49 std::function<llvm::Error(llvm::Module *)>
51  llvm::Optional<unsigned> mbOptLevel,
52  llvm::TargetMachine *targetMachine,
53  unsigned optPassesInsertPos = 0);
54 
55 } // end namespace mlir
56 
57 #endif // LIR_EXECUTIONENGINE_OPTUTILS_H_
Definition: InferTypeOpInterface.cpp:20
Definition: PassRegistry.cpp:413
Definition: LLVM.h:40
std::function< llvm::Error(llvm::Module *)> makeOptimizingTransformer(unsigned optLevel, unsigned sizeLevel, llvm::TargetMachine *targetMachine)
Definition: OptUtils.h:40
std::function< llvm::Error(llvm::Module *)> makeLLVMPassesTransformer(llvm::ArrayRef< const llvm::PassInfo *> llvmPasses, llvm::Optional< unsigned > mbOptLevel, llvm::TargetMachine *targetMachine, unsigned optPassesInsertPos=0)
Definition: OptUtils.h:50
Definition: LLVM.h:37
void initializeLLVMPasses()
Definition: OptUtils.cpp:46