[Mlir-commits] [mlir] [mlir] Extend affine.min/max ValueBoundsOpInterfaceImpls (PR #118840)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Jan 21 08:26:47 PST 2025
================
@@ -67,6 +67,27 @@ struct AffineMinOpInterface
expr.replaceDimsAndSymbols(dimReplacements, symReplacements);
cstr.bound(value) <= bound;
}
+ // Get all constant lower bounds, choose minimum, and set lower bound to it.
+ MLIRContext *ctx = op->getContext();
+ AffineMap map = minOp.getAffineMap();
+ SmallVector<Value> mapOperands = minOp.getOperands();
+ std::optional<int64_t> minBound;
+ for (AffineExpr expr : map.getResults()) {
+ auto exprMap =
+ AffineMap::get(map.getNumDims(), map.getNumSymbols(), expr, ctx);
+ ValueBoundsConstraintSet::Variable exprVar(exprMap, mapOperands);
+ FailureOr<int64_t> exprBound =
+ cstr.computeConstantBound(presburger::BoundType::LB, exprVar,
----------------
Max191 wrote:
I see, thanks for the suggestion. I'll look into these options.
https://github.com/llvm/llvm-project/pull/118840
More information about the Mlir-commits
mailing list