Jlm
StoreValueForwarding.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2026 HÃ¥vard Krogstie <krogstie.havard@gmail.com>
3  * See COPYING for terms of redistribution.
4  */
5 
6 #ifndef JLM_LLVM_OPT_STOREVALUEFORWARDING_HPP
7 #define JLM_LLVM_OPT_STOREVALUEFORWARDING_HPP
8 
12 
13 namespace jlm::rvsdg
14 {
15 class Region;
16 }
17 
18 namespace jlm::llvm
19 {
20 
21 struct StoreValueOrigin;
22 class LoadTracingInfo;
23 
30 {
31  class Statistics;
32  struct Context;
33 
34 public:
35  ~StoreValueForwarding() noexcept override;
36 
38 
40 
42 
44  operator=(const StoreValueForwarding &) = delete;
45 
47  operator=(StoreValueForwarding &&) = delete;
48 
49  void
50  Run(rvsdg::RvsdgModule & module, util::StatisticsCollector & statisticsCollector) override;
51 
52 private:
58  void
59  traverseInterProceduralRegion(rvsdg::Region & region);
60 
66  void
67  traverseIntraProceduralRegion(rvsdg::Region & region);
68 
74  void
75  processLoadNode(rvsdg::SimpleNode & loadNode);
76 
83  void
84  forwardStoredValues(LoadTracingInfo & tracingInfo);
85 
96  rvsdg::Output &
98  StoreValueOrigin storeValueOrigin,
99  rvsdg::Region & targetRegion,
100  LoadTracingInfo & tracingInfo);
101 
108  void
110 
119  rvsdg::Output &
120  routeOutputToRegion(rvsdg::Output & output, rvsdg::Region & region);
121 
122  std::unique_ptr<Context> context_;
123 };
124 
125 }
126 
127 #endif
static jlm::util::StatisticsCollector statisticsCollector
Store Value Forwarding Statistics class.
Store Value Forwarding Optimization.
~StoreValueForwarding() noexcept override
std::unique_ptr< Context > context_
void connectUnroutedLoopPosts(LoadTracingInfo &tracingInfo)
void processLoadNode(rvsdg::SimpleNode &loadNode)
rvsdg::Output & routeOutputToRegion(rvsdg::Output &output, rvsdg::Region &region)
void Run(rvsdg::RvsdgModule &module, util::StatisticsCollector &statisticsCollector) override
Perform RVSDG transformation.
rvsdg::Output & getStoredValueOrigin(StoreValueOrigin storeValueOrigin, rvsdg::Region &targetRegion, LoadTracingInfo &tracingInfo)
void traverseInterProceduralRegion(rvsdg::Region &region)
void traverseIntraProceduralRegion(rvsdg::Region &region)
void forwardStoredValues(LoadTracingInfo &tracingInfo)
Represents an RVSDG transformation.
Global memory state passed between functions.