Lang Hames | e2b201b | 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 | |
| 10 | #ifndef LLVM_CODEGEN_SPILLER_H |
| 11 | #define LLVM_CODEGEN_SPILLER_H |
| 12 | |
Lang Hames | e2b201b | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 13 | namespace llvm { |
Lang Hames | 10382fb | 2009-06-19 02:17:53 +0000 | [diff] [blame] | 14 | |
Jakob Stoklund Olesen | 47dbf6c | 2011-03-10 01:51:42 +0000 | [diff] [blame] | 15 | class LiveRangeEdit; |
Bill Wendling | cd35ed5 | 2009-05-19 17:52:31 +0000 | [diff] [blame] | 16 | class MachineFunction; |
Jakob Stoklund Olesen | f2c6e36 | 2010-07-20 23:50:15 +0000 | [diff] [blame] | 17 | class MachineFunctionPass; |
Lang Hames | 10382fb | 2009-06-19 02:17:53 +0000 | [diff] [blame] | 18 | class VirtRegMap; |
Lang Hames | e2b201b | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 19 | |
| 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 Hames | 857c4e0 | 2009-06-17 21:01:20 +0000 | [diff] [blame] | 27 | |
Jakob Stoklund Olesen | 47dbf6c | 2011-03-10 01:51:42 +0000 | [diff] [blame] | 28 | /// spill - Spill the LRE.getParent() live interval. |
| 29 | virtual void spill(LiveRangeEdit &LRE) = 0; |
Lang Hames | 857c4e0 | 2009-06-17 21:01:20 +0000 | [diff] [blame] | 30 | |
Lang Hames | e2b201b | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | /// Create and return a spiller object, as specified on the command line. |
Jakob Stoklund Olesen | f2c6e36 | 2010-07-20 23:50:15 +0000 | [diff] [blame] | 34 | Spiller* createSpiller(MachineFunctionPass &pass, |
| 35 | MachineFunction &mf, |
| 36 | VirtRegMap &vrm); |
Jakob Stoklund Olesen | f6dff84 | 2010-12-10 22:54:44 +0000 | [diff] [blame] | 37 | |
| 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 Hames | e2b201b | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | #endif |