aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/RegAllocPBQP.h
blob: 0ae0088a899f978efe75fd2ad18fa45b8b744bc6 (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
29
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef RCC_CODEGEN_REGALLOCPBQP_H
#define RCC_CODEGEN_REGALLOCPBQP_H

#include "rcc/CodeGen/RegAllocCommon.h"
#include "rcc/CodeGen/TargetRegisterAllocationInfo.h"

namespace rcc {

class PBQPAllocatorPass final : public MachineFunctionPass {
public:
  explicit PBQPAllocatorPass(const TargetRegisterAllocationInfo &Info,
                             RegisterAllocationOptions Options = {}) noexcept
      : Info(&Info), Options(Options) {}

  [[nodiscard]] const MachinePassContract &contract() const noexcept override;
  [[nodiscard]] Expected<MachinePassResult> run(MachineFunction &Function,
                                                const TargetDescription &Target,
                                                MachineFunctionAnalysisManager &Analyses) override;

private:
  const TargetRegisterAllocationInfo *Info;
  RegisterAllocationOptions Options;
};

} // namespace rcc

#endif // RCC_CODEGEN_REGALLOCPBQP_H