mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
RegisterAllocator.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <unordered_set>
6
7
#include "
mini-llvm/mir/BasicBlockBuilder.h
"
8
#include "
mini-llvm/mir/Function.h
"
9
#include "
mini-llvm/mir/PhysicalRegister.h
"
10
#include "
mini-llvm/mir/Register.h
"
11
#include "
mini-llvm/mir/StackSlot.h
"
12
#include "
mini-llvm/mir/VirtualRegister.h
"
13
#include "
mini-llvm/utils/Compiler.h
"
14
#include "
mini-llvm/utils/FunctionRef.h
"
15
16
namespace
mini_llvm
{
17
18
class
MINI_LLVM_EXPORT
RegisterAllocator
{
19
public
:
20
using
RegisterAction
=
FunctionRef
<
21
void (
mir::Register
*reg,
mir::StackSlot
*slot,
const
mir::BasicBlockBuilder
&builder)
22
>;
23
24
virtual
~RegisterAllocator
() =
default
;
25
26
RegisterAllocator
() =
default
;
27
28
RegisterAllocator
(
const
RegisterAllocator
&) =
delete
;
29
RegisterAllocator
&
operator=
(
const
RegisterAllocator
&) =
delete
;
30
31
RegisterAllocator
(
RegisterAllocator
&&) =
delete
;
32
RegisterAllocator
&
operator=
(
RegisterAllocator
&&) =
delete
;
33
34
virtual
bool
allocate
(
mir::Function
&F,
35
const
std::unordered_set<mir::VirtualRegister *> &virtRegs,
36
const
std::unordered_set<mir::PhysicalRegister *> &physRegs,
37
RegisterAction
load,
38
RegisterAction
store
39
) = 0;
40
};
41
42
}
// namespace mini_llvm
BasicBlockBuilder.h
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
FunctionRef.h
PhysicalRegister.h
Register.h
StackSlot.h
VirtualRegister.h
mini_llvm::FunctionRef
Definition
FunctionRef.h:13
mini_llvm::RegisterAllocator::allocate
virtual bool allocate(mir::Function &F, const std::unordered_set< mir::VirtualRegister * > &virtRegs, const std::unordered_set< mir::PhysicalRegister * > &physRegs, RegisterAction load, RegisterAction store)=0
mini_llvm::RegisterAllocator::RegisterAllocator
RegisterAllocator(const RegisterAllocator &)=delete
mini_llvm::RegisterAllocator::RegisterAction
FunctionRef< void(mir::Register *reg, mir::StackSlot *slot, const mir::BasicBlockBuilder &builder) > RegisterAction
Definition
RegisterAllocator.h:20
mini_llvm::RegisterAllocator::~RegisterAllocator
virtual ~RegisterAllocator()=default
mini_llvm::RegisterAllocator::RegisterAllocator
RegisterAllocator()=default
mini_llvm::RegisterAllocator::operator=
RegisterAllocator & operator=(const RegisterAllocator &)=delete
mini_llvm::RegisterAllocator::operator=
RegisterAllocator & operator=(RegisterAllocator &&)=delete
mini_llvm::RegisterAllocator::RegisterAllocator
RegisterAllocator(RegisterAllocator &&)=delete
mini_llvm::mir::BasicBlockBuilder
Definition
BasicBlockBuilder.h:14
mini_llvm::mir::Function
Definition
Function.h:21
mini_llvm::mir::Register
Definition
Register.h:14
mini_llvm::mir::StackSlot
Definition
StackSlot.h:11
Function.h
mini_llvm
Definition
GraphColoringAllocator.h:13
include
mini-llvm
codegen
RegisterAllocator.h
Generated by
1.17.0