]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/llvm/include/llvm/CodeGen/MachineSizeOpts.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / llvm / include / llvm / CodeGen / MachineSizeOpts.h
1 //===- MachineSizeOpts.h - machine size optimization ------------*- C++ -*-===//
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 //
9 // This file contains some shared machine IR code size optimization related
10 // code.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CODEGEN_MACHINE_SIZEOPTS_H
14 #define LLVM_CODEGEN_MACHINE_SIZEOPTS_H
15
16 #include "llvm/Transforms/Utils/SizeOpts.h"
17
18 namespace llvm {
19
20 class ProfileSummaryInfo;
21 class MachineBasicBlock;
22 class MachineBlockFrequencyInfo;
23 class MachineFunction;
24
25 /// Returns true if machine function \p MF is suggested to be size-optimized
26 /// based on the profile.
27 bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI,
28                            const MachineBlockFrequencyInfo *BFI,
29                            PGSOQueryType QueryType = PGSOQueryType::Other);
30 /// Returns true if machine basic block \p MBB is suggested to be size-optimized
31 /// based on the profile.
32 bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
33                            ProfileSummaryInfo *PSI,
34                            const MachineBlockFrequencyInfo *MBFI,
35                            PGSOQueryType QueryType = PGSOQueryType::Other);
36
37 } // end namespace llvm
38
39 #endif // LLVM_CODEGEN_MACHINE_SIZEOPTS_H