Eugene Zelenko | 900b633 | 2017-08-29 22:32:07 +0000 | [diff] [blame] | 1 | //===- llvm/CodeGen/Spiller.h - Spiller -------------------------*- C++ -*-===// |
Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 9 | #ifndef LLVM_LIB_CODEGEN_SPILLER_H |
| 10 | #define LLVM_LIB_CODEGEN_SPILLER_H |
Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 11 | |
Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 12 | namespace llvm { |
Lang Hames | 6b2c960 | 2009-06-19 02:17:53 +0000 | [diff] [blame] | 13 | |
Eugene Zelenko | 900b633 | 2017-08-29 22:32:07 +0000 | [diff] [blame] | 14 | class LiveRangeEdit; |
| 15 | class MachineFunction; |
| 16 | class MachineFunctionPass; |
| 17 | class VirtRegMap; |
Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 18 | |
| 19 | /// Spiller interface. |
| 20 | /// |
| 21 | /// Implementations are utility classes which insert spill or remat code on |
| 22 | /// demand. |
| 23 | class Spiller { |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 24 | virtual void anchor(); |
Eugene Zelenko | 900b633 | 2017-08-29 22:32:07 +0000 | [diff] [blame] | 25 | |
Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 26 | public: |
| 27 | virtual ~Spiller() = 0; |
Lang Hames | 16cab19 | 2009-06-17 21:01:20 +0000 | [diff] [blame] | 28 | |
Jakob Stoklund Olesen | 4d6eafa | 2011-03-10 01:51:42 +0000 | [diff] [blame] | 29 | /// spill - Spill the LRE.getParent() live interval. |
| 30 | virtual void spill(LiveRangeEdit &LRE) = 0; |
Eugene Zelenko | 900b633 | 2017-08-29 22:32:07 +0000 | [diff] [blame] | 31 | |
| 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); |
Lang Hames | cf47d01 | 2009-05-18 19:03:16 +0000 | [diff] [blame] | 40 | |
Eugene Zelenko | 900b633 | 2017-08-29 22:32:07 +0000 | [diff] [blame] | 41 | } // end namespace llvm |
| 42 | |
| 43 | #endif // LLVM_LIB_CODEGEN_SPILLER_H |