llvm/mlir/unittests/Analysis/Presburger/SimplexTest.cpp

//===- SimplexTest.cpp - Tests for Simplex --------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

#include "Parser.h"
#include "Utils.h"

#include "mlir/Analysis/Presburger/Simplex.h"
#include "mlir/IR/MLIRContext.h"

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <optional>

usingnamespacemlir;
usingnamespacepresburger;

/// Convenience functions to pass literals to Simplex.
void addInequality(SimplexBase &simplex, ArrayRef<int64_t> coeffs) {}
void addEquality(SimplexBase &simplex, ArrayRef<int64_t> coeffs) {}
bool isRedundantInequality(Simplex &simplex, ArrayRef<int64_t> coeffs) {}
bool isRedundantInequality(LexSimplex &simplex, ArrayRef<int64_t> coeffs) {}
bool isRedundantEquality(Simplex &simplex, ArrayRef<int64_t> coeffs) {}
bool isSeparateInequality(LexSimplex &simplex, ArrayRef<int64_t> coeffs) {}

Simplex::IneqType findIneqType(Simplex &simplex, ArrayRef<int64_t> coeffs) {}

/// Take a snapshot, add constraints making the set empty, and rollback.
/// The set should not be empty after rolling back. We add additional
/// constraints after the set is already empty and roll back the addition
/// of these. The set should be marked non-empty only once we rollback
/// past the addition of the first constraint that made it empty.
TEST(SimplexTest, emptyRollback) {}

/// Check that the set gets marked as empty when we add contradictory
/// constraints.
TEST(SimplexTest, addEquality_separate) {}

void expectInequalityMakesSetEmpty(Simplex &simplex, ArrayRef<int64_t> coeffs,
                                   bool expect) {}

TEST(SimplexTest, addInequality_rollback) {}

Simplex simplexFromConstraints(unsigned nDim,
                               ArrayRef<SmallVector<int64_t, 8>> ineqs,
                               ArrayRef<SmallVector<int64_t, 8>> eqs) {}

TEST(SimplexTest, isUnbounded) {}

TEST(SimplexTest, getSamplePointIfIntegral) {}

/// Some basic sanity checks involving zero or one variables.
TEST(SimplexTest, isMarkedRedundant_no_var_ge_zero) {}

TEST(SimplexTest, isMarkedRedundant_no_var_eq) {}

TEST(SimplexTest, isMarkedRedundant_pos_var_eq) {}

TEST(SimplexTest, isMarkedRedundant_zero_var_eq) {}

TEST(SimplexTest, isMarkedRedundant_neg_var_eq) {}

TEST(SimplexTest, isMarkedRedundant_pos_var_ge) {}

TEST(SimplexTest, isMarkedRedundant_zero_var_ge) {}

TEST(SimplexTest, isMarkedRedundant_neg_var_ge) {}

/// None of the constraints are redundant. Slightly more complicated test
/// involving an equality.
TEST(SimplexTest, isMarkedRedundant_no_redundant) {}

TEST(SimplexTest, isMarkedRedundant_repeated_constraints) {}

TEST(SimplexTest, isMarkedRedundant) {}

TEST(SimplexTest, isMarkedRedundantTiledLoopNestConstraints) {}

TEST(SimplexTest, pivotRedundantRegressionTest) {}

TEST(SimplexTest, addInequality_already_redundant) {}

TEST(SimplexTest, appendVariable) {}

TEST(SimplexTest, isRedundantInequality) {}

TEST(SimplexTest, ineqType) {}

TEST(SimplexTest, isRedundantEquality) {}

TEST(SimplexTest, IsRationalSubsetOf) {}

TEST(SimplexTest, addDivisionVariable) {}

TEST(SimplexTest, LexIneqType) {}