blob: 330ee81342b6fabdbb98685826f08eb15bdd6130 [file] [log] [blame]
Eugene Zelenko7cf6af52017-08-29 22:32:07 +00001//===- llvm/CodeGen/Spiller.h - Spiller -------------------------*- C++ -*-===//
Lang Hamese2b201b2009-05-18 19:03:16 +00002//
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
Benjamin Kramer00e08fc2014-08-13 16:26:38 +000010#ifndef LLVM_LIB_CODEGEN_SPILLER_H
11#define LLVM_LIB_CODEGEN_SPILLER_H
Lang Hamese2b201b2009-05-18 19:03:16 +000012
Lang Hamese2b201b2009-05-18 19:03:16 +000013namespace llvm {
Lang Hames10382fb2009-06-19 02:17:53 +000014
Eugene Zelenko7cf6af52017-08-29 22:32:07 +000015class LiveRangeEdit;
16class MachineFunction;
17class MachineFunctionPass;
18class 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 {
David Blaikie2d24e2a2011-12-20 02:50:00 +000025 virtual void anchor();
Eugene Zelenko7cf6af52017-08-29 22:32:07 +000026
Lang Hamese2b201b2009-05-18 19:03:16 +000027 public:
28 virtual ~Spiller() = 0;
Lang Hames857c4e02009-06-17 21:01:20 +000029
Jakob Stoklund Olesen47dbf6c2011-03-10 01:51:42 +000030 /// spill - Spill the LRE.getParent() live interval.
31 virtual void spill(LiveRangeEdit &LRE) = 0;
Eugene Zelenko7cf6af52017-08-29 22:32:07 +000032
33 virtual void postOptimization() {}
Lang Hamese2b201b2009-05-18 19:03:16 +000034 };
35
Jakob Stoklund Olesenf6dff842010-12-10 22:54:44 +000036 /// Create and return a spiller that will insert spill code directly instead
37 /// of deferring though VirtRegMap.
38 Spiller *createInlineSpiller(MachineFunctionPass &pass,
39 MachineFunction &mf,
40 VirtRegMap &vrm);
Lang Hamese2b201b2009-05-18 19:03:16 +000041
Eugene Zelenko7cf6af52017-08-29 22:32:07 +000042} // end namespace llvm
43
44#endif // LLVM_LIB_CODEGEN_SPILLER_H