Spiller.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //===- llvm/CodeGen/Spiller.h - Spiller -------------------------*- 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. #ifndef LLVM_LIB_CODEGEN_SPILLER_H
  9. #define LLVM_LIB_CODEGEN_SPILLER_H
  10. namespace llvm {
  11. class LiveRangeEdit;
  12. class MachineFunction;
  13. class MachineFunctionPass;
  14. class VirtRegMap;
  15. /// Spiller interface.
  16. ///
  17. /// Implementations are utility classes which insert spill or remat code on
  18. /// demand.
  19. class Spiller {
  20. virtual void anchor();
  21. public:
  22. virtual ~Spiller() = 0;
  23. /// spill - Spill the LRE.getParent() live interval.
  24. virtual void spill(LiveRangeEdit &LRE) = 0;
  25. virtual void postOptimization() {}
  26. };
  27. /// Create and return a spiller that will insert spill code directly instead
  28. /// of deferring though VirtRegMap.
  29. Spiller *createInlineSpiller(MachineFunctionPass &pass,
  30. MachineFunction &mf,
  31. VirtRegMap &vrm);
  32. } // end namespace llvm
  33. #endif // LLVM_LIB_CODEGEN_SPILLER_H