Spiller.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- llvm/CodeGen/Spiller.h - Spiller -------------------------*- 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. #ifndef LLVM_CODEGEN_SPILLER_H
  14. #define LLVM_CODEGEN_SPILLER_H
  15. namespace llvm {
  16. class LiveRangeEdit;
  17. class MachineFunction;
  18. class MachineFunctionPass;
  19. class VirtRegMap;
  20. class VirtRegAuxInfo;
  21. /// Spiller interface.
  22. ///
  23. /// Implementations are utility classes which insert spill or remat code on
  24. /// demand.
  25. class Spiller {
  26. virtual void anchor();
  27. public:
  28. virtual ~Spiller() = 0;
  29. /// spill - Spill the LRE.getParent() live interval.
  30. virtual void spill(LiveRangeEdit &LRE) = 0;
  31. virtual void postOptimization() {}
  32. };
  33. /// Create and return a spiller that will insert spill code directly instead
  34. /// of deferring though VirtRegMap.
  35. Spiller *createInlineSpiller(MachineFunctionPass &Pass, MachineFunction &MF,
  36. VirtRegMap &VRM, VirtRegAuxInfo &VRAI);
  37. } // end namespace llvm
  38. #endif // LLVM_CODEGEN_SPILLER_H
  39. #ifdef __GNUC__
  40. #pragma GCC diagnostic pop
  41. #endif