blob: 41f1727da43921b102c79ea94b91508f785425e8 [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
Lang Hamese2b201b2009-05-18 19:03:16 +000013namespace llvm {
Lang Hames10382fb2009-06-19 02:17:53 +000014
Jakob Stoklund Olesen47dbf6c2011-03-10 01:51:42 +000015 class LiveRangeEdit;
Bill Wendlingcd35ed52009-05-19 17:52:31 +000016 class MachineFunction;
Jakob Stoklund Olesenf2c6e362010-07-20 23:50:15 +000017 class MachineFunctionPass;
Lang Hames10382fb2009-06-19 02:17:53 +000018 class VirtRegMap;
Lang Hamese2b201b2009-05-18 19:03:16 +000019
20 /// Spiller interface.
21 ///
22 /// Implementations are utility classes which insert spill or remat code on
23 /// demand.
24 class Spiller {
25 public:
26 virtual ~Spiller() = 0;
Lang Hames857c4e02009-06-17 21:01:20 +000027
Jakob Stoklund Olesen47dbf6c2011-03-10 01:51:42 +000028 /// spill - Spill the LRE.getParent() live interval.
29 virtual void spill(LiveRangeEdit &LRE) = 0;
Lang Hames857c4e02009-06-17 21:01:20 +000030
Lang Hamese2b201b2009-05-18 19:03:16 +000031 };
32
33 /// Create and return a spiller object, as specified on the command line.
Jakob Stoklund Olesenf2c6e362010-07-20 23:50:15 +000034 Spiller* createSpiller(MachineFunctionPass &pass,
35 MachineFunction &mf,
36 VirtRegMap &vrm);
Jakob Stoklund Olesenf6dff842010-12-10 22:54:44 +000037
38 /// Create and return a spiller that will insert spill code directly instead
39 /// of deferring though VirtRegMap.
40 Spiller *createInlineSpiller(MachineFunctionPass &pass,
41 MachineFunction &mf,
42 VirtRegMap &vrm);
43
Lang Hamese2b201b2009-05-18 19:03:16 +000044}
45
46#endif