blob: 86d7db23c7b981bfd08dfa2ee1be5eb5de577b8c [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 Hamesf41538d2009-06-02 16:53:25 +000016 class LiveInterval;
Bill Wendlingcd35ed52009-05-19 17:52:31 +000017 class LiveIntervals;
Lang Hamesf41538d2009-06-02 16:53:25 +000018 class LiveStacks;
Bill Wendlingcd35ed52009-05-19 17:52:31 +000019 class MachineFunction;
20 class VirtRegMap;
Lang Hames857c4e02009-06-17 21:01:20 +000021 class MachineInstr;
Lang Hamese2b201b2009-05-18 19:03:16 +000022
23 /// Spiller interface.
24 ///
25 /// Implementations are utility classes which insert spill or remat code on
26 /// demand.
27 class Spiller {
28 public:
29 virtual ~Spiller() = 0;
Lang Hames857c4e02009-06-17 21:01:20 +000030
31 /// Spill the given live range. The method used will depend on the Spiller
32 /// implementation selected.
Bill Wendling0bde89e2009-05-19 17:51:26 +000033 virtual std::vector<LiveInterval*> spill(LiveInterval *li) = 0;
Lang Hames857c4e02009-06-17 21:01:20 +000034
Lang Hamese2b201b2009-05-18 19:03:16 +000035 };
36
37 /// Create and return a spiller object, as specified on the command line.
Bill Wendling0bde89e2009-05-19 17:51:26 +000038 Spiller* createSpiller(MachineFunction *mf, LiveIntervals *li,
Lang Hamesf41538d2009-06-02 16:53:25 +000039 LiveStacks *ls, VirtRegMap *vrm);
Lang Hamese2b201b2009-05-18 19:03:16 +000040}
41
42#endif