MachineSizeOpts.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- MachineSizeOpts.h - machine size optimization ------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file contains some shared machine IR code size optimization related
  15. // code.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CODEGEN_MACHINESIZEOPTS_H
  19. #define LLVM_CODEGEN_MACHINESIZEOPTS_H
  20. #include "llvm/Transforms/Utils/SizeOpts.h"
  21. namespace llvm {
  22. class ProfileSummaryInfo;
  23. class MachineBasicBlock;
  24. class MachineBlockFrequencyInfo;
  25. class MachineFunction;
  26. class MBFIWrapper;
  27. /// Returns true if machine function \p MF is suggested to be size-optimized
  28. /// based on the profile.
  29. bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI,
  30. const MachineBlockFrequencyInfo *BFI,
  31. PGSOQueryType QueryType = PGSOQueryType::Other);
  32. /// Returns true if machine basic block \p MBB is suggested to be size-optimized
  33. /// based on the profile.
  34. bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
  35. ProfileSummaryInfo *PSI,
  36. const MachineBlockFrequencyInfo *MBFI,
  37. PGSOQueryType QueryType = PGSOQueryType::Other);
  38. /// Returns true if machine basic block \p MBB is suggested to be size-optimized
  39. /// based on the profile.
  40. bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
  41. ProfileSummaryInfo *PSI,
  42. MBFIWrapper *MBFIWrapper,
  43. PGSOQueryType QueryType = PGSOQueryType::Other);
  44. } // end namespace llvm
  45. #endif // LLVM_CODEGEN_MACHINESIZEOPTS_H
  46. #ifdef __GNUC__
  47. #pragma GCC diagnostic pop
  48. #endif