From 495c675771f43cfa12ab7a426a538be72fec1805 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sun, 9 Aug 2026 17:03:19 +0800 Subject: [CodeGen] Implement machine optimization and scheduling --- .../include/rcc/CodeGen/TargetPseudoExpansion.h | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 backend/include/rcc/CodeGen/TargetPseudoExpansion.h (limited to 'backend/include/rcc/CodeGen/TargetPseudoExpansion.h') diff --git a/backend/include/rcc/CodeGen/TargetPseudoExpansion.h b/backend/include/rcc/CodeGen/TargetPseudoExpansion.h new file mode 100644 index 0000000..4d9f556 --- /dev/null +++ b/backend/include/rcc/CodeGen/TargetPseudoExpansion.h @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef RCC_CODEGEN_TARGETPSEUDOEXPANSION_H +#define RCC_CODEGEN_TARGETPSEUDOEXPANSION_H + +#include "rcc/Support/Error.h" + +#include + +namespace rcc { + +class MachineFunction; +class MachineInstr; +class TargetDescription; + +enum class MachinePseudoExpansionPhase : std::uint8_t { + PrePEI, + PostRA, + TargetLate, +}; + +class TargetPseudoExpansionInfo { +public: + virtual ~TargetPseudoExpansionInfo() = default; + + [[nodiscard]] virtual Expected preparePostRAPseudo(MachineInstr &, MachineFunction &, + const TargetDescription &) const { + return false; + } + + [[nodiscard]] virtual Expected expandPseudo(MachineInstr &, MachinePseudoExpansionPhase, + MachineFunction &, + const TargetDescription &) const { + return false; + } +}; + +} // namespace rcc + +#endif // RCC_CODEGEN_TARGETPSEUDOEXPANSION_H -- cgit v1.2.3