MLIR 22.0.0git
ValueBoundsOpInterfaceImpl.h
Go to the documentation of this file.
1//===- ValueBoundsOpInterfaceImpl.h - Impl. of ValueBoundsOpInterface -----===//
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_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H
10#define MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H
11
12#include "mlir/Support/LLVM.h"
13#include <cstdint>
14
15namespace mlir {
16class DialectRegistry;
17class Value;
18
19namespace affine {
20void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry);
21
22/// Compute a constant delta of the given two values. Return "failure" if we
23/// cannot determine a constant delta. `value1`/`value2` must be index-typed.
24///
25/// This function is similar to
26/// `ValueBoundsConstraintSet::computeConstantDistance`. To work around
27/// limitations in `FlatLinearConstraints`, this function fully composes
28/// `value1` and `value2` (if they are the result of affine.apply ops) before
29/// populating the constraint set. The folding/composing logic can see
30/// opportunities for simplifications that the constraint set implementation
31/// cannot see.
32FailureOr<int64_t> fullyComposeAndComputeConstantDelta(Value value1,
33 Value value2);
34} // namespace affine
35} // namespace mlir
36
37#endif // MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
FailureOr< int64_t > fullyComposeAndComputeConstantDelta(Value value1, Value value2)
Compute a constant delta of the given two values.
Include the generated interface declarations.