1 //===- MachineSizeOpts.h - machine size optimization ------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file contains some shared machine IR code size optimization related
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CODEGEN_MACHINE_SIZEOPTS_H
14 #define LLVM_CODEGEN_MACHINE_SIZEOPTS_H
16 #include "llvm/Transforms/Utils/SizeOpts.h"
20 class ProfileSummaryInfo;
21 class MachineBasicBlock;
22 class MachineBlockFrequencyInfo;
23 class MachineFunction;
26 /// Returns true if machine function \p MF is suggested to be size-optimized
27 /// based on the profile.
28 bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI,
29 const MachineBlockFrequencyInfo *BFI,
30 PGSOQueryType QueryType = PGSOQueryType::Other);
31 /// Returns true if machine basic block \p MBB is suggested to be size-optimized
32 /// based on the profile.
33 bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
34 ProfileSummaryInfo *PSI,
35 const MachineBlockFrequencyInfo *MBFI,
36 PGSOQueryType QueryType = PGSOQueryType::Other);
37 /// Returns true if machine basic block \p MBB is suggested to be size-optimized
38 /// based on the profile.
39 bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
40 ProfileSummaryInfo *PSI,
41 MBFIWrapper *MBFIWrapper,
42 PGSOQueryType QueryType = PGSOQueryType::Other);
44 } // end namespace llvm
46 #endif // LLVM_CODEGEN_MACHINE_SIZEOPTS_H