MLIR  19.0.0git
SROA.h
Go to the documentation of this file.
1 //===-- SROA.h - Scalar Replacement Of Aggregates ---------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef MLIR_TRANSFORMS_SROA_H
10 #define MLIR_TRANSFORMS_SROA_H
11 
14 #include "llvm/ADT/Statistic.h"
15 
16 namespace mlir {
17 
18 /// Statistics collected while applying SROA.
20  /// Total amount of memory slots destructured.
21  llvm::Statistic *destructuredAmount = nullptr;
22  /// Total amount of memory slots in which the destructured size was smaller
23  /// than the total size after eliminating unused fields.
24  llvm::Statistic *slotsWithMemoryBenefit = nullptr;
25  /// Maximal number of sub-elements a successfully destructured slot initially
26  /// had.
27  llvm::Statistic *maxSubelementAmount = nullptr;
28 };
29 
30 /// Attempts to destructure the slots of destructurable allocators. Returns
31 /// failure if no slot was destructured.
34  RewriterBase &rewriter, const DataLayout &dataLayout,
35  SROAStatistics statistics = {});
36 
37 } // namespace mlir
38 
39 #endif // MLIR_TRANSFORMS_SROA_H
The main mechanism for performing data layout queries.
This class coordinates the application of a rewrite on a set of IR, providing a way for clients to tr...
Definition: PatternMatch.h:400
Include the generated interface declarations.
LogicalResult tryToDestructureMemorySlots(ArrayRef< DestructurableAllocationOpInterface > allocators, RewriterBase &rewriter, const DataLayout &dataLayout, SROAStatistics statistics={})
Attempts to destructure the slots of destructurable allocators.
Definition: SROA.cpp:192
This class represents an efficient way to signal success or failure.
Definition: LogicalResult.h:26
Statistics collected while applying SROA.
Definition: SROA.h:19
llvm::Statistic * maxSubelementAmount
Maximal number of sub-elements a successfully destructured slot initially had.
Definition: SROA.h:27
llvm::Statistic * slotsWithMemoryBenefit
Total amount of memory slots in which the destructured size was smaller than the total size after eli...
Definition: SROA.h:24
llvm::Statistic * destructuredAmount
Total amount of memory slots destructured.
Definition: SROA.h:21