MachineSizeOpts.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #include "llvm/Transforms/Utils/SizeOpts.h"
  16. namespace llvm {
  17. class ProfileSummaryInfo;
  18. class MachineBasicBlock;
  19. class MachineBlockFrequencyInfo;
  20. class MachineFunction;
  21. class MBFIWrapper;
  22. /// Returns true if machine function \p MF is suggested to be size-optimized
  23. /// based on the profile.
  24. bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI,
  25. const MachineBlockFrequencyInfo *BFI,
  26. PGSOQueryType QueryType = PGSOQueryType::Other);
  27. /// Returns true if machine basic block \p MBB is suggested to be size-optimized
  28. /// based on the profile.
  29. bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
  30. ProfileSummaryInfo *PSI,
  31. const MachineBlockFrequencyInfo *MBFI,
  32. PGSOQueryType QueryType = PGSOQueryType::Other);
  33. /// Returns true if machine basic block \p MBB is suggested to be size-optimized
  34. /// based on the profile.
  35. bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
  36. ProfileSummaryInfo *PSI,
  37. MBFIWrapper *MBFIWrapper,
  38. PGSOQueryType QueryType = PGSOQueryType::Other);
  39. } // end namespace llvm
  40. #endif // LLVM_CODEGEN_MACHINESIZEOPTS_H