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