MLIR  22.0.0git
StridedMetadataRangeAnalysis.h
Go to the documentation of this file.
1 //===- StridedMetadataRange.h - Strided metadata range analysis -*- 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_ANALYSIS_DATAFLOW_STRIDEDMETADATARANGE_H
10 #define MLIR_ANALYSIS_DATAFLOW_STRIDEDMETADATARANGE_H
11 
14 
15 namespace mlir {
16 namespace dataflow {
17 
18 /// This lattice element represents the strided metadata of an SSA value.
19 class StridedMetadataRangeLattice : public Lattice<StridedMetadataRange> {
20 public:
21  using Lattice::Lattice;
22 };
23 
24 /// Strided metadata range analysis determines the strided metadata ranges of
25 /// SSA values using operations that define `InferStridedMetadataInterface`.
26 ///
27 /// This analysis depends on DeadCodeAnalysis, SparseConstantPropagation, and
28 /// IntegerRangeAnalysis, and will be a silent no-op if the analyses are not
29 /// loaded in the same solver context.
31  : public SparseForwardDataFlowAnalysis<StridedMetadataRangeLattice> {
32 public:
34  int32_t indexBitwidth = 64);
35 
36  /// At an entry point, we cannot reason about strided metadata ranges unless
37  /// the type also encodes the data. For example, a memref with static layout.
38  void setToEntryState(StridedMetadataRangeLattice *lattice) override;
39 
40  /// Visit an operation. Invoke the transfer function on each operation that
41  /// implements `InferStridedMetadataInterface`.
42  LogicalResult
46 
47 private:
48  /// Index bitwidth to use when operating with the int-ranges.
49  int32_t indexBitwidth = 64;
50 };
51 } // namespace dataflow
52 } // end namespace mlir
53 
54 #endif // MLIR_ANALYSIS_DATAFLOW_STRIDEDMETADATARANGE_H
The general data-flow analysis solver.
Operation is the basic unit of execution within MLIR.
Definition: Operation.h:88
This class represents a lattice holding a specific value of type ValueT.
A sparse forward data-flow analysis for propagating SSA value lattices across the IR by implementing ...
Strided metadata range analysis determines the strided metadata ranges of SSA values using operations...
void setToEntryState(StridedMetadataRangeLattice *lattice) override
At an entry point, we cannot reason about strided metadata ranges unless the type also encodes the da...
StridedMetadataRangeAnalysis(DataFlowSolver &solver, int32_t indexBitwidth=64)
LogicalResult visitOperation(Operation *op, ArrayRef< const StridedMetadataRangeLattice * > operands, ArrayRef< StridedMetadataRangeLattice * > results) override
Visit an operation.
This lattice element represents the strided metadata of an SSA value.
Include the generated interface declarations.