| Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 1 | //===-- 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 Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 10 | #ifndef LLVM_LIB_CODEGEN_SPILLER_H | 
|  | 11 | #define LLVM_LIB_CODEGEN_SPILLER_H | 
| Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 12 |  | 
| Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 13 | namespace llvm { | 
| Lang Hames | 6b2c960 | 2009-06-19 02:17:53 +0000 | [diff] [blame] | 14 |  | 
| Jakob Stoklund Olesen | 4d6eafa | 2011-03-10 01:51:42 +0000 | [diff] [blame] | 15 | class LiveRangeEdit; | 
| Bill Wendling | 670da9a | 2009-05-19 17:52:31 +0000 | [diff] [blame] | 16 | class MachineFunction; | 
| Jakob Stoklund Olesen | 0fef9dd | 2010-07-20 23:50:15 +0000 | [diff] [blame] | 17 | class MachineFunctionPass; | 
| Lang Hames | 6b2c960 | 2009-06-19 02:17:53 +0000 | [diff] [blame] | 18 | class VirtRegMap; | 
| Wei Mi | 9a16d65 | 2016-04-13 03:08:27 +0000 | [diff] [blame] | 19 | class LiveIntervals; | 
| Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 20 |  | 
|  | 21 | /// Spiller interface. | 
|  | 22 | /// | 
|  | 23 | /// Implementations are utility classes which insert spill or remat code on | 
|  | 24 | /// demand. | 
|  | 25 | class Spiller { | 
| David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 26 | virtual void anchor(); | 
| Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 27 | public: | 
|  | 28 | virtual ~Spiller() = 0; | 
| Lang Hames | 16cab19 | 2009-06-17 21:01:20 +0000 | [diff] [blame] | 29 |  | 
| Jakob Stoklund Olesen | 4d6eafa | 2011-03-10 01:51:42 +0000 | [diff] [blame] | 30 | /// spill - Spill the LRE.getParent() live interval. | 
|  | 31 | virtual void spill(LiveRangeEdit &LRE) = 0; | 
| Wei Mi | 9a16d65 | 2016-04-13 03:08:27 +0000 | [diff] [blame] | 32 | virtual void postOptimization(){}; | 
| Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 33 | }; | 
|  | 34 |  | 
| Jakob Stoklund Olesen | adecb5e | 2010-12-10 22:54:44 +0000 | [diff] [blame] | 35 | /// 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 Kornienko | f00654e | 2015-06-23 09:49:53 +0000 | [diff] [blame] | 40 | } | 
| Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 41 |  | 
|  | 42 | #endif |