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;
22
23/// Spiller interface.
24///
25/// Implementations are utility classes which insert spill or remat code on
26/// demand.
27class Spiller {
28 virtual void anchor();
29
30public:
31 virtual ~Spiller() = 0;
32
33 /// spill - Spill the LRE.getParent() live interval.
34 virtual void spill(LiveRangeEdit &LRE) = 0;
35
36 /// Return the registers that were spilled.
38
39 /// Return registers that were not spilled, but otherwise replaced
40 /// (e.g. rematerialized).
42
43 virtual void postOptimization() {}
44};
45
46/// Create and return a spiller that will insert spill code directly instead
47/// of deferring though VirtRegMap.
48Spiller *createInlineSpiller(MachineFunctionPass &Pass, MachineFunction &MF,
49 VirtRegMap &VRM, VirtRegAuxInfo &VRAI);
50
51} // end namespace llvm
52
53#endif // LLVM_CODEGEN_SPILLER_H
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
Spiller interface.
Definition: Spiller.h:27
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:43
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Spiller * createInlineSpiller(MachineFunctionPass &Pass, MachineFunction &MF, VirtRegMap &VRM, VirtRegAuxInfo &VRAI)
Create and return a spiller that will insert spill code directly instead of deferring though VirtRegM...