Spiller.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //===-- llvm/CodeGen/Spiller.h - Spiller -*- C++ -*------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef LLVM_CODEGEN_SPILLER_H
  10. #define LLVM_CODEGEN_SPILLER_H
  11. namespace llvm {
  12. class LiveInterval;
  13. class MachineFunction;
  14. class MachineFunctionPass;
  15. class SlotIndex;
  16. template <typename T> class SmallVectorImpl;
  17. class VirtRegMap;
  18. /// Spiller interface.
  19. ///
  20. /// Implementations are utility classes which insert spill or remat code on
  21. /// demand.
  22. class Spiller {
  23. public:
  24. virtual ~Spiller() = 0;
  25. /// spill - Spill the given live interval. The method used will depend on
  26. /// the Spiller implementation selected.
  27. ///
  28. /// @param li The live interval to be spilled.
  29. /// @param spillIs A list of intervals that are about to be spilled,
  30. /// and so cannot be used for remat etc.
  31. /// @param newIntervals The newly created intervals will be appended here.
  32. virtual void spill(LiveInterval *li,
  33. SmallVectorImpl<LiveInterval*> &newIntervals,
  34. const SmallVectorImpl<LiveInterval*> &spillIs) = 0;
  35. };
  36. /// Create and return a spiller object, as specified on the command line.
  37. Spiller* createSpiller(MachineFunctionPass &pass,
  38. MachineFunction &mf,
  39. VirtRegMap &vrm);
  40. /// Create and return a spiller that will insert spill code directly instead
  41. /// of deferring though VirtRegMap.
  42. Spiller *createInlineSpiller(MachineFunctionPass &pass,
  43. MachineFunction &mf,
  44. VirtRegMap &vrm);
  45. }
  46. #endif