Jlm
Loading...
Searching...
No Matches
Transformation.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2025 Nico Reißmann <nico.reissmann@gmail.com>
3 * See COPYING for terms of redistribution.
4 */
5
6#ifndef JLM_RVSDG_TRANSFORMATION_HPP
7#define JLM_RVSDG_TRANSFORMATION_HPP
8
11
12namespace jlm::rvsdg
13{
14
15class RvsdgModule;
16
21{
22public:
24
26 : Name_(Name)
27 {}
28
29 [[nodiscard]] const std::string_view &
31 {
32 return Name_;
33 }
34
45 virtual void
47
57 void
63
64private:
65 std::string_view Name_;
66};
67
72{
73 class Statistics;
74
75public:
77
87
94 void
96
106 static void
110 std::vector<std::shared_ptr<Transformation>> transformations,
112 const bool dumpRvsdgGraphs)
113 {
115 std::move(transformations),
116 dotWriter,
117 dumpRvsdgGraphs);
119 }
120
121private:
122 void
125 const util::FilePath & filePath,
126 const std::string & passName,
127 size_t numPass) const;
128
131 std::vector<std::shared_ptr<Transformation>> Transformations_;
132};
133
134}
135
136#endif // JLM_RVSDG_TRANSFORMATION_HPP
static jlm::util::StatisticsCollector statisticsCollector
std::vector< std::shared_ptr< Transformation > > Transformations_
void DumpDotGraphs(RvsdgModule &rvsdgModule, const util::FilePath &filePath, const std::string &passName, size_t numPass) const
static void CreateAndRun(RvsdgModule &rvsdgModule, util::StatisticsCollector &statisticsCollector, std::vector< std::shared_ptr< Transformation > > transformations, DotWriter &dotWriter, const bool dumpRvsdgGraphs)
Creates a transformation sequence and invokes its Run() method.
~TransformationSequence() noexcept override
void Run(RvsdgModule &rvsdgModule, util::StatisticsCollector &statisticsCollector) override
Perform RVSDG transformations.
Represents an RVSDG transformation.
virtual void Run(RvsdgModule &module, util::StatisticsCollector &statisticsCollector)=0
Perform RVSDG transformation.
virtual ~Transformation() noexcept
const std::string_view & GetName() const noexcept
void Run(RvsdgModule &module)
Perform RVSDG transformation.
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
Definition node.hpp:872