Fixed some bugs.
[llvm/zpu.git] / lib / CodeGen / Spiller.h
blobb0a5c4126683b1ba45a717f673f4b17d925bddaf
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 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CODEGEN_SPILLER_H
11 #define LLVM_CODEGEN_SPILLER_H
13 namespace llvm {
15 class LiveInterval;
16 class MachineFunction;
17 class MachineFunctionPass;
18 class SlotIndex;
19 template <typename T> class SmallVectorImpl;
20 class VirtRegMap;
22 /// Spiller interface.
23 ///
24 /// Implementations are utility classes which insert spill or remat code on
25 /// demand.
26 class Spiller {
27 public:
28 virtual ~Spiller() = 0;
30 /// spill - Spill the given live interval. The method used will depend on
31 /// the Spiller implementation selected.
32 ///
33 /// @param li The live interval to be spilled.
34 /// @param spillIs A list of intervals that are about to be spilled,
35 /// and so cannot be used for remat etc.
36 /// @param newIntervals The newly created intervals will be appended here.
37 virtual void spill(LiveInterval *li,
38 SmallVectorImpl<LiveInterval*> &newIntervals,
39 SmallVectorImpl<LiveInterval*> &spillIs) = 0;
43 /// Create and return a spiller object, as specified on the command line.
44 Spiller* createSpiller(MachineFunctionPass &pass,
45 MachineFunction &mf,
46 VirtRegMap &vrm);
49 #endif