From cd30fb546e389d1fb78ce8e579b3dba3a8fdb52a Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Thu, 13 Aug 2026 21:11:10 +0800 Subject: [CodeGen] Match LLVM machine copy propagation --- backend/include/rcc/CodeGen/MachineCopyPropagation.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'backend/include/rcc/CodeGen/MachineCopyPropagation.h') diff --git a/backend/include/rcc/CodeGen/MachineCopyPropagation.h b/backend/include/rcc/CodeGen/MachineCopyPropagation.h index ab8b23f..59a3a77 100644 --- a/backend/include/rcc/CodeGen/MachineCopyPropagation.h +++ b/backend/include/rcc/CodeGen/MachineCopyPropagation.h @@ -6,26 +6,21 @@ #include "rcc/CodeGen/MachinePassManager.h" #include -#include namespace rcc { class TargetInstrInfo; -enum class MachineCopyPropagationStage : std::uint8_t { - PreRegisterAllocation, - PostRegisterAllocation, -}; - struct MachineCopyPropagationOptions final { std::size_t MaximumPropagatedCopies = 10'000; + bool UseTargetCopyInstructions = false; }; class MachineCopyPropagationPass final : public MachineFunctionPass { public: - MachineCopyPropagationPass(const TargetInstrInfo &Info, MachineCopyPropagationStage Stage, - MachineCopyPropagationOptions Options = {}) noexcept - : Info(&Info), Stage(Stage), Options(Options) {} + explicit MachineCopyPropagationPass(const TargetInstrInfo &Info, + MachineCopyPropagationOptions Options = {}) noexcept + : Info(&Info), Options(Options) {} [[nodiscard]] const MachinePassContract &contract() const noexcept override; [[nodiscard]] Expected run(MachineFunction &Function, @@ -38,7 +33,6 @@ private: MachineActionReplay &Actions) const; const TargetInstrInfo *Info; - MachineCopyPropagationStage Stage; MachineCopyPropagationOptions Options; }; -- cgit v1.2.3