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"
18 class MachineFunction;
19 class MachineFunctionPass;
23 /// Spiller interface.
25 /// Implementations are utility classes which insert spill or remat code on
29 virtual ~Spiller() = 0;
31 /// spill - Spill the given live interval. The method used will depend on
32 /// the Spiller implementation selected.
34 /// @param li The live interval to be spilled.
35 /// @param spillIs A list of intervals that are about to be spilled,
36 /// and so cannot be used for remat etc.
37 /// @param newIntervals The newly created intervals will be appended here.
38 virtual void spill(LiveInterval *li,
39 SmallVectorImpl<LiveInterval*> &newIntervals,
40 SmallVectorImpl<LiveInterval*> &spillIs) = 0;
44 /// Create and return a spiller object, as specified on the command line.
45 Spiller* createSpiller(MachineFunctionPass &pass,