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 | |
| 13 | #include <vector> |
| 14 | |
| 15 | namespace llvm { |
Lang Hames | 10382fb | 2009-06-19 02:17:53 +0000 | [diff] [blame] | 16 | |
Lang Hames | f41538d | 2009-06-02 16:53:25 +0000 | [diff] [blame] | 17 | class LiveInterval; |
Bill Wendling | cd35ed5 | 2009-05-19 17:52:31 +0000 | [diff] [blame] | 18 | class LiveIntervals; |
Lang Hames | f41538d | 2009-06-02 16:53:25 +0000 | [diff] [blame] | 19 | class LiveStacks; |
Bill Wendling | cd35ed5 | 2009-05-19 17:52:31 +0000 | [diff] [blame] | 20 | class MachineFunction; |
Lang Hames | 857c4e0 | 2009-06-17 21:01:20 +0000 | [diff] [blame] | 21 | class MachineInstr; |
Lang Hames | 10382fb | 2009-06-19 02:17:53 +0000 | [diff] [blame] | 22 | class VirtRegMap; |
| 23 | class VNInfo; |
Lang Hames | e2b201b | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 24 | |
| 25 | /// Spiller interface. |
| 26 | /// |
| 27 | /// Implementations are utility classes which insert spill or remat code on |
| 28 | /// demand. |
| 29 | class Spiller { |
| 30 | public: |
| 31 | virtual ~Spiller() = 0; |
Lang Hames | 857c4e0 | 2009-06-17 21:01:20 +0000 | [diff] [blame] | 32 | |
| 33 | /// Spill the given live range. The method used will depend on the Spiller |
| 34 | /// implementation selected. |
Bill Wendling | 0bde89e | 2009-05-19 17:51:26 +0000 | [diff] [blame] | 35 | virtual std::vector<LiveInterval*> spill(LiveInterval *li) = 0; |
Lang Hames | 857c4e0 | 2009-06-17 21:01:20 +0000 | [diff] [blame] | 36 | |
Lang Hames | 10382fb | 2009-06-19 02:17:53 +0000 | [diff] [blame] | 37 | /// Intra-block split. |
| 38 | virtual std::vector<LiveInterval*> intraBlockSplit(LiveInterval *li, |
| 39 | VNInfo *valno) = 0; |
| 40 | |
Lang Hames | e2b201b | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | /// Create and return a spiller object, as specified on the command line. |
Bill Wendling | 0bde89e | 2009-05-19 17:51:26 +0000 | [diff] [blame] | 44 | Spiller* createSpiller(MachineFunction *mf, LiveIntervals *li, |
Lang Hames | f41538d | 2009-06-02 16:53:25 +0000 | [diff] [blame] | 45 | LiveStacks *ls, VirtRegMap *vrm); |
Lang Hames | e2b201b | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | #endif |