LLVM 20.0.0git
Spiller.h
Go to the documentation of this file.
1//===- llvm/CodeGen/Spiller.h - Spiller -------------------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CODEGEN_SPILLER_H
10#define LLVM_CODEGEN_SPILLER_H
11
12#include "llvm/ADT/ArrayRef.h"
14
15namespace llvm {
16
17class LiveRangeEdit;
18class MachineFunction;
19class MachineFunctionPass;
20class VirtRegMap;
21class VirtRegAuxInfo;
22class LiveIntervals;
23class LiveStacks;
24class MachineDominatorTree;
25class MachineBlockFrequencyInfo;
26
27/// Spiller interface.
28///
29/// Implementations are utility classes which insert spill or remat code on
30/// demand.
31class Spiller {
32 virtual void anchor();
33
34public:
35 virtual ~Spiller() = 0;
36
37 /// spill - Spill the LRE.getParent() live interval.
38 virtual void spill(LiveRangeEdit &LRE) = 0;
39
40 /// Return the registers that were spilled.
42
43 /// Return registers that were not spilled, but otherwise replaced
44 /// (e.g. rematerialized).
46
47 virtual void postOptimization() {}
48
54 };
55};
56
57/// Create and return a spiller that will insert spill code directly instead
58/// of deferring though VirtRegMap.
61 VirtRegAuxInfo &VRAI);
62
63} // end namespace llvm
64
65#endif // LLVM_CODEGEN_SPILLER_H
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
Spiller interface.
Definition: Spiller.h:31
virtual void spill(LiveRangeEdit &LRE)=0
spill - Spill the LRE.getParent() live interval.
virtual ~Spiller()=0
virtual ArrayRef< Register > getReplacedRegs()=0
Return registers that were not spilled, but otherwise replaced (e.g.
virtual ArrayRef< Register > getSpilledRegs()=0
Return the registers that were spilled.
virtual void postOptimization()
Definition: Spiller.h:47
Calculate auxiliary information for a virtual register such as its spill weight and allocation hint.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Spiller * createInlineSpiller(const Spiller::RequiredAnalyses &Analyses, MachineFunction &MF, VirtRegMap &VRM, VirtRegAuxInfo &VRAI)
Create and return a spiller that will insert spill code directly instead of deferring though VirtRegM...
const MachineBlockFrequencyInfo & MBFI
Definition: Spiller.h:53
MachineDominatorTree & MDT
Definition: Spiller.h:52