Jlm
AggregateAllocaSplitting.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2026 Nico Reißmann <nico.reissmann@gmail.com>
3  * See COPYING for terms of redistribution.
4  */
5 
6 #ifndef JLM_LLVM_OPT_AGGREGATEALLOCASPLITTING_HPP
7 #define JLM_LLVM_OPT_AGGREGATEALLOCASPLITTING_HPP
8 
10 
11 namespace jlm::llvm
12 {
13 
23 {
24  struct Context;
25  class Statistics;
26  struct AllocaTraceInfo;
27 
28 public:
29  ~AggregateAllocaSplitting() noexcept override;
30 
32 
33  void
34  Run(rvsdg::RvsdgModule & module, util::StatisticsCollector & statisticsCollector) override;
35 
36 private:
37  void
38  splitAllocaNodes(rvsdg::RvsdgModule & rvsdgModule);
39 
40  std::vector<AllocaTraceInfo>
41  findSplitableAllocaNodes(rvsdg::Region & region) const;
42 
43  static void
44  splitAllocaNode(const AllocaTraceInfo & allocaTraceInfo);
45 
46  static bool
47  checkGetElementPtrUsers(const rvsdg::SimpleNode & gepNode);
48 
49  static std::optional<AllocaTraceInfo>
50  isSplitable(rvsdg::SimpleNode & allocaNode);
51 
52  static bool
53  isSplitableType(const rvsdg::Type & type);
54 
55  std::unique_ptr<Context> context_{};
56 };
57 
58 }
59 
60 #endif
static jlm::util::StatisticsCollector statisticsCollector
Aggregate Alloca Splitting Transformation.
static bool checkGetElementPtrUsers(const rvsdg::SimpleNode &gepNode)
void Run(rvsdg::RvsdgModule &module, util::StatisticsCollector &statisticsCollector) override
Perform RVSDG transformation.
static void splitAllocaNode(const AllocaTraceInfo &allocaTraceInfo)
void splitAllocaNodes(rvsdg::RvsdgModule &rvsdgModule)
static bool isSplitableType(const rvsdg::Type &type)
static std::optional< AllocaTraceInfo > isSplitable(rvsdg::SimpleNode &allocaNode)
~AggregateAllocaSplitting() noexcept override
std::vector< AllocaTraceInfo > findSplitableAllocaNodes(rvsdg::Region &region) const
Represents an RVSDG transformation.
Global memory state passed between functions.