aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/CodeGen/MachineCopyPropagation.h
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-13 21:11:10 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-13 21:11:10 +0800
commitcd30fb546e389d1fb78ce8e579b3dba3a8fdb52a (patch)
tree891d7065c52e56d3f559b146f3a07055105d9d4e /backend/include/rcc/CodeGen/MachineCopyPropagation.h
parent98cae0e8835a1eb8fcb0e43870c04ed934cc51ac (diff)
downloadrcc-project-cd30fb546e389d1fb78ce8e579b3dba3a8fdb52a.tar.gz
rcc-project-cd30fb546e389d1fb78ce8e579b3dba3a8fdb52a.tar.xz
[CodeGen] Match LLVM machine copy propagation
Diffstat (limited to 'backend/include/rcc/CodeGen/MachineCopyPropagation.h')
-rw-r--r--backend/include/rcc/CodeGen/MachineCopyPropagation.h14
1 files changed, 4 insertions, 10 deletions
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 <cstddef>
-#include <cstdint>
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<MachinePassResult> run(MachineFunction &Function,
@@ -38,7 +33,6 @@ private:
MachineActionReplay &Actions) const;
const TargetInstrInfo *Info;
- MachineCopyPropagationStage Stage;
MachineCopyPropagationOptions Options;
};