blob: 61ee508c8394323503c3786854816a353aff8445 [file] [log] [blame]
Lang Hamescf47d012009-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
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000010#ifndef LLVM_LIB_CODEGEN_SPILLER_H
11#define LLVM_LIB_CODEGEN_SPILLER_H
Lang Hamescf47d012009-05-18 19:03:16 +000012
Lang Hamescf47d012009-05-18 19:03:16 +000013namespace llvm {
Lang Hames6b2c9602009-06-19 02:17:53 +000014
Jakob Stoklund Olesen4d6eafa2011-03-10 01:51:42 +000015 class LiveRangeEdit;
Bill Wendling670da9a2009-05-19 17:52:31 +000016 class MachineFunction;
Jakob Stoklund Olesen0fef9dd2010-07-20 23:50:15 +000017 class MachineFunctionPass;
Lang Hames6b2c9602009-06-19 02:17:53 +000018 class VirtRegMap;
Wei Mi9a16d652016-04-13 03:08:27 +000019 class LiveIntervals;
Lang Hamescf47d012009-05-18 19:03:16 +000020
21 /// Spiller interface.
22 ///
23 /// Implementations are utility classes which insert spill or remat code on
24 /// demand.
25 class Spiller {
David Blaikiea379b1812011-12-20 02:50:00 +000026 virtual void anchor();
Lang Hamescf47d012009-05-18 19:03:16 +000027 public:
28 virtual ~Spiller() = 0;
Lang Hames16cab192009-06-17 21:01:20 +000029
Jakob Stoklund Olesen4d6eafa2011-03-10 01:51:42 +000030 /// spill - Spill the LRE.getParent() live interval.
31 virtual void spill(LiveRangeEdit &LRE) = 0;
Wei Mi9a16d652016-04-13 03:08:27 +000032 virtual void postOptimization(){};
Lang Hamescf47d012009-05-18 19:03:16 +000033 };
34
Jakob Stoklund Olesenadecb5e2010-12-10 22:54:44 +000035 /// Create and return a spiller that will insert spill code directly instead
36 /// of deferring though VirtRegMap.
37 Spiller *createInlineSpiller(MachineFunctionPass &pass,
38 MachineFunction &mf,
39 VirtRegMap &vrm);
Alexander Kornienkof00654e2015-06-23 09:49:53 +000040}
Lang Hamescf47d012009-05-18 19:03:16 +000041
42#endif