Jlm
IfConversion.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_LLVM_OPT_IFCONVERSION_HPP
7 #define JLM_LLVM_OPT_IFCONVERSION_HPP
8 
9 #include <jlm/rvsdg/gamma.hpp>
11 
12 namespace jlm::rvsdg
13 {
14 class GammaNode;
15 class Region;
16 }
17 
18 namespace jlm::llvm
19 {
20 
28 class IfConversion final : public rvsdg::Transformation
29 {
30 public:
31  ~IfConversion() noexcept override;
32 
33  IfConversion();
34 
35  IfConversion(const IfConversion &) = delete;
36 
37  IfConversion(IfConversion &&) = delete;
38 
39  IfConversion &
40  operator=(const IfConversion &) = delete;
41 
42  IfConversion &
43  operator=(IfConversion &&) = delete;
44 
45  void
46  Run(rvsdg::RvsdgModule & module, util::StatisticsCollector & statisticsCollector) override;
47 
48 private:
49  static void
50  HandleRegion(rvsdg::Region & region);
51 
52  static void
53  HandleGammaNode(const rvsdg::GammaNode & gammaNode);
54 };
55 
56 }
57 
58 #endif // JLM_LLVM_OPT_IFCONVERSION_HPP
If-Conversion Transformation.
void Run(rvsdg::RvsdgModule &module, util::StatisticsCollector &statisticsCollector) override
Perform RVSDG transformation.
static void HandleGammaNode(const rvsdg::GammaNode &gammaNode)
static void HandleRegion(rvsdg::Region &region)
~IfConversion() noexcept override
Represents an RVSDG transformation.
Global memory state passed between functions.