1*9880d681SAndroid Build Coastguard Worker //===-- llvm/CodeGen/Spiller.h - Spiller -*- C++ -*------------------------===// 2*9880d681SAndroid Build Coastguard Worker // 3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure 4*9880d681SAndroid Build Coastguard Worker // 5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source 6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details. 7*9880d681SAndroid Build Coastguard Worker // 8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_CODEGEN_SPILLER_H 11*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_CODEGEN_SPILLER_H 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Worker namespace llvm { 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Worker class LiveRangeEdit; 16*9880d681SAndroid Build Coastguard Worker class MachineFunction; 17*9880d681SAndroid Build Coastguard Worker class MachineFunctionPass; 18*9880d681SAndroid Build Coastguard Worker class VirtRegMap; 19*9880d681SAndroid Build Coastguard Worker class LiveIntervals; 20*9880d681SAndroid Build Coastguard Worker 21*9880d681SAndroid Build Coastguard Worker /// Spiller interface. 22*9880d681SAndroid Build Coastguard Worker /// 23*9880d681SAndroid Build Coastguard Worker /// Implementations are utility classes which insert spill or remat code on 24*9880d681SAndroid Build Coastguard Worker /// demand. 25*9880d681SAndroid Build Coastguard Worker class Spiller { 26*9880d681SAndroid Build Coastguard Worker virtual void anchor(); 27*9880d681SAndroid Build Coastguard Worker public: 28*9880d681SAndroid Build Coastguard Worker virtual ~Spiller() = 0; 29*9880d681SAndroid Build Coastguard Worker 30*9880d681SAndroid Build Coastguard Worker /// spill - Spill the LRE.getParent() live interval. 31*9880d681SAndroid Build Coastguard Worker virtual void spill(LiveRangeEdit &LRE) = 0; postOptimization()32*9880d681SAndroid Build Coastguard Worker virtual void postOptimization(){}; 33*9880d681SAndroid Build Coastguard Worker }; 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Worker /// Create and return a spiller that will insert spill code directly instead 36*9880d681SAndroid Build Coastguard Worker /// of deferring though VirtRegMap. 37*9880d681SAndroid Build Coastguard Worker Spiller *createInlineSpiller(MachineFunctionPass &pass, 38*9880d681SAndroid Build Coastguard Worker MachineFunction &mf, 39*9880d681SAndroid Build Coastguard Worker VirtRegMap &vrm); 40*9880d681SAndroid Build Coastguard Worker } 41*9880d681SAndroid Build Coastguard Worker 42*9880d681SAndroid Build Coastguard Worker #endif 43