blob: 9c3900df0b57b2f555548403f2b75c4644beae22 [file] [log] [blame]
Lang Hamese2b201b2009-05-18 19:03:16 +00001//===-- 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
10#ifndef LLVM_CODEGEN_SPILLER_H
11#define LLVM_CODEGEN_SPILLER_H
12
13#include <vector>
14
15namespace llvm {
Lang Hames10382fb2009-06-19 02:17:53 +000016
Lang Hamesf41538d2009-06-02 16:53:25 +000017 class LiveInterval;
Bill Wendlingcd35ed52009-05-19 17:52:31 +000018 class LiveIntervals;
Lang Hamesf41538d2009-06-02 16:53:25 +000019 class LiveStacks;
Bill Wendlingcd35ed52009-05-19 17:52:31 +000020 class MachineFunction;
Lang Hames857c4e02009-06-17 21:01:20 +000021 class MachineInstr;
Lang Hames10382fb2009-06-19 02:17:53 +000022 class VirtRegMap;
23 class VNInfo;
Lang Hamese2b201b2009-05-18 19:03:16 +000024
25 /// Spiller interface.
26 ///
27 /// Implementations are utility classes which insert spill or remat code on
28 /// demand.
29 class Spiller {
30 public:
31 virtual ~Spiller() = 0;
Lang Hames857c4e02009-06-17 21:01:20 +000032
33 /// Spill the given live range. The method used will depend on the Spiller
34 /// implementation selected.
Bill Wendling0bde89e2009-05-19 17:51:26 +000035 virtual std::vector<LiveInterval*> spill(LiveInterval *li) = 0;
Lang Hames857c4e02009-06-17 21:01:20 +000036
Lang Hames10382fb2009-06-19 02:17:53 +000037 /// Intra-block split.
38 virtual std::vector<LiveInterval*> intraBlockSplit(LiveInterval *li,
39 VNInfo *valno) = 0;
40
Lang Hamese2b201b2009-05-18 19:03:16 +000041 };
42
43 /// Create and return a spiller object, as specified on the command line.
Bill Wendling0bde89e2009-05-19 17:51:26 +000044 Spiller* createSpiller(MachineFunction *mf, LiveIntervals *li,
Lang Hamesf41538d2009-06-02 16:53:25 +000045 LiveStacks *ls, VirtRegMap *vrm);
Lang Hamese2b201b2009-05-18 19:03:16 +000046}
47
48#endif