1 //===-- llvm/CodeGen/Spiller.h - Spiller -*- C++ -*------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CODEGEN_SPILLER_H
11 #define LLVM_CODEGEN_SPILLER_H
13 #include "llvm/ADT/SmallVector.h"
21 class MachineFunction;
23 class MachineLoopInfo;
28 /// Spiller interface.
30 /// Implementations are utility classes which insert spill or remat code on
34 virtual ~Spiller() = 0;
36 /// spill - Spill the given live interval. The method used will depend on
37 /// the Spiller implementation selected.
39 /// @param li The live interval to be spilled.
40 /// @param spillIs A list of intervals that are about to be spilled,
41 /// and so cannot be used for remat etc.
42 /// @param newIntervals The newly created intervals will be appended here.
43 /// @param earliestIndex The earliest point for splitting. (OK, it's another
44 /// pointer to the allocator guts).
45 virtual void spill(LiveInterval *li,
46 std::vector<LiveInterval*> &newIntervals,
47 SmallVectorImpl<LiveInterval*> &spillIs,
48 SlotIndex *earliestIndex = 0) = 0;
52 /// Create and return a spiller object, as specified on the command line.
53 Spiller* createSpiller(MachineFunction *mf, LiveIntervals *li,
54 const MachineLoopInfo *loopInfo, VirtRegMap *vrm);