#ifndef MLIR_INTERFACES_UTILS_INFERINTRANGECOMMON_H
#define MLIR_INTERFACES_UTILS_INFERINTRANGECOMMON_H
#include "mlir/Interfaces/InferIntRangeInterface.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitmaskEnum.h"
#include <optional>
namespace mlir {
namespace intrange {
InferRangeFn;
InferIntegerValueRangeFn;
static constexpr unsigned indexMinWidth = …;
static constexpr unsigned indexMaxWidth = …;
enum class CmpMode : uint32_t { … };
enum class OverflowFlags : uint32_t { … };
InferRangeWithOvfFlagsFn;
ConstantIntRanges inferIndexOp(const InferRangeFn &inferFn,
ArrayRef<ConstantIntRanges> argRanges,
CmpMode mode);
ConstantIntRanges extRange(const ConstantIntRanges &range, unsigned destWidth);
ConstantIntRanges extUIRange(const ConstantIntRanges &range,
unsigned destWidth);
ConstantIntRanges extSIRange(const ConstantIntRanges &range,
unsigned destWidth);
ConstantIntRanges truncRange(const ConstantIntRanges &range,
unsigned destWidth);
ConstantIntRanges inferAdd(ArrayRef<ConstantIntRanges> argRanges,
OverflowFlags ovfFlags = OverflowFlags::None);
ConstantIntRanges inferSub(ArrayRef<ConstantIntRanges> argRanges,
OverflowFlags ovfFlags = OverflowFlags::None);
ConstantIntRanges inferMul(ArrayRef<ConstantIntRanges> argRanges,
OverflowFlags ovfFlags = OverflowFlags::None);
ConstantIntRanges inferDivS(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferDivU(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferCeilDivS(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferCeilDivU(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferFloorDivS(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferRemS(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferRemU(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferMaxS(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferMaxU(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferMinS(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferMinU(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferAnd(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferOr(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferXor(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferShl(ArrayRef<ConstantIntRanges> argRanges,
OverflowFlags ovfFlags = OverflowFlags::None);
ConstantIntRanges inferShrS(ArrayRef<ConstantIntRanges> argRanges);
ConstantIntRanges inferShrU(ArrayRef<ConstantIntRanges> argRanges);
enum class CmpPredicate : uint64_t { … };
std::optional<bool> evaluatePred(CmpPredicate pred,
const ConstantIntRanges &lhs,
const ConstantIntRanges &rhs);
}
}
#endif