aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/RegAllocCommon.h
blob: 5994d6406a4368f68137239ab8bffb9ad456f116 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef RCC_CODEGEN_REGALLOCCOMMON_H
#define RCC_CODEGEN_REGALLOCCOMMON_H

#include "rcc/CodeGen/MachinePassManager.h"

#include <memory>

namespace rcc {

class TargetRegisterAllocationInfo;

struct RegisterAllocationOptions final {
  bool EnableRematerialization = true;
  bool EnableCopyCoalescing = true;
};

[[nodiscard]] std::unique_ptr<MachineFunctionPass>
createBasicAllocatorPass(const TargetRegisterAllocationInfo &Info,
                         RegisterAllocationOptions Options = {});
[[nodiscard]] std::unique_ptr<MachineFunctionPass>
createGreedyAllocatorPass(const TargetRegisterAllocationInfo &Info,
                          RegisterAllocationOptions Options = {});

} // namespace rcc

#endif // RCC_CODEGEN_REGALLOCCOMMON_H