aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/RegAllocPBQP.h
diff options
context:
space:
mode:
Diffstat (limited to 'backend/include/rcc/CodeGen/RegAllocPBQP.h')
-rw-r--r--backend/include/rcc/CodeGen/RegAllocPBQP.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/backend/include/rcc/CodeGen/RegAllocPBQP.h b/backend/include/rcc/CodeGen/RegAllocPBQP.h
new file mode 100644
index 0000000..368cbee
--- /dev/null
+++ b/backend/include/rcc/CodeGen/RegAllocPBQP.h
@@ -0,0 +1,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,
+ MachineAnalysisManager &Analyses) override;
+
+private:
+ const TargetRegisterAllocationInfo *Info;
+ RegisterAllocationOptions Options;
+};
+
+} // namespace rcc
+
+#endif // RCC_CODEGEN_REGALLOCPBQP_H