LLVM 19.0.0git
MachineSizeOpts.h
Go to the documentation of this file.
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_MACHINESIZEOPTS_H
14#define LLVM_CODEGEN_MACHINESIZEOPTS_H
15
17
18namespace llvm {
19
20class ProfileSummaryInfo;
21class MachineBasicBlock;
22class MachineBlockFrequencyInfo;
23class MachineFunction;
24class MBFIWrapper;
25
26/// Returns true if machine function \p MF is suggested to be size-optimized
27/// based on the profile.
28bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI,
29 const MachineBlockFrequencyInfo *BFI,
31/// Returns true if machine basic block \p MBB is suggested to be size-optimized
32/// based on the profile.
33bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
34 ProfileSummaryInfo *PSI,
35 const MachineBlockFrequencyInfo *MBFI,
37/// Returns true if machine basic block \p MBB is suggested to be size-optimized
38/// based on the profile.
39bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
40 ProfileSummaryInfo *PSI,
41 MBFIWrapper *MBFIWrapper,
43
44} // end namespace llvm
45
46#endif // LLVM_CODEGEN_MACHINESIZEOPTS_H
MachineBasicBlock & MBB
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI, const MachineBlockFrequencyInfo *BFI, PGSOQueryType QueryType=PGSOQueryType::Other)
Returns true if machine function MF is suggested to be size-optimized based on the profile.
PGSOQueryType
Definition: SizeOpts.h:34