forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MLIR][FlatAffineConstraints][NFC] Move some static functions to be a…
…vailable to Presburger/ This patch moves some static functions from AffineStructures.cpp to Presburger/Utils.cpp and some to be private members of FlatAffineConstraints (which will later be moved to IntegerPolyhedron) to allow for a smoother transition for moving FlatAffineConstraints math functionality to Presburger/IntegerPolyhedron. This patch is part of a series of patches for moving math functionality to Presburger directory. Reviewed By: arjunp, bondhugula Differential Revision: https://reviews.llvm.org/D115869
- Loading branch information
Showing
7 changed files
with
289 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//===- Utils.h - General utilities for Presburger library ------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Utility functions required by the Presburger Library. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef MLIR_ANALYSIS_PRESBURGER_UTILS_H | ||
#define MLIR_ANALYSIS_PRESBURGER_UTILS_H | ||
|
||
#include "mlir/Support/LLVM.h" | ||
|
||
namespace mlir { | ||
|
||
class IntegerPolyhedron; | ||
|
||
namespace presburger_utils { | ||
|
||
/// Check if the pos^th identifier can be expressed as a floordiv of an affine | ||
/// function of other identifiers (where the divisor is a positive constant). | ||
/// `foundRepr` contains a boolean for each identifier indicating if the | ||
/// explicit representation for that identifier has already been computed. | ||
/// Returns the upper and lower bound inequalities using which the floordiv | ||
/// can be computed. If the representation could be computed, `dividend` and | ||
/// `denominator` are set. If the representation could not be computed, | ||
/// `llvm::None` is returned. | ||
Optional<std::pair<unsigned, unsigned>> | ||
computeSingleVarRepr(const IntegerPolyhedron &cst, ArrayRef<bool> foundRepr, | ||
unsigned pos, SmallVector<int64_t, 8> ÷nd, | ||
unsigned &divisor); | ||
|
||
} // namespace presburger_utils | ||
} // namespace mlir | ||
|
||
#endif // MLIR_ANALYSIS_PRESBURGER_UTILS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.