[Mlir-commits] [mlir] [mlir][transform] Plumb a simplified form of AffineMin folding into t… (PR #145170)
Nicolas Vasilache
llvmlistbot at llvm.org
Mon Jun 23 03:10:48 PDT 2025
================
@@ -1256,26 +1328,25 @@ mlir::affine::makeComposedFoldedAffineApply(OpBuilder &b, Location loc,
return llvm::getSingleElement(foldResults);
}
-OpFoldResult
-mlir::affine::makeComposedFoldedAffineApply(OpBuilder &b, Location loc,
- AffineExpr expr,
- ArrayRef<OpFoldResult> operands) {
+OpFoldResult mlir::affine::makeComposedFoldedAffineApply(
+ OpBuilder &b, Location loc, AffineExpr expr,
+ ArrayRef<OpFoldResult> operands, bool composeAffineMin) {
return makeComposedFoldedAffineApply(
b, loc,
AffineMap::inferFromExprList(ArrayRef<AffineExpr>{expr}, b.getContext())
.front(),
- operands);
+ operands, composeAffineMin);
}
SmallVector<OpFoldResult>
mlir::affine::makeComposedFoldedMultiResultAffineApply(
- OpBuilder &b, Location loc, AffineMap map,
- ArrayRef<OpFoldResult> operands) {
- return llvm::map_to_vector(llvm::seq<unsigned>(0, map.getNumResults()),
- [&](unsigned i) {
- return makeComposedFoldedAffineApply(
- b, loc, map.getSubMap({i}), operands);
- });
+ OpBuilder &b, Location loc, AffineMap map, ArrayRef<OpFoldResult> operands,
+ bool composeAffineMin) {
+ return llvm::map_to_vector(
+ llvm::seq<unsigned>(0, map.getNumResults()), [&](unsigned i) {
----------------
nicolasvasilache wrote:
Fully agree and have been using int64_t pervasively, except in APIs that are historically unsigned and will trigger
debates / large updates.
I like peppering around [the cpp con panel discussion on this topic](https://www.youtube.com/watch?v=Puio5dly9N8) which is pretty clear @12:15 and 13:00.
But yeah strong +1 to sanitizing unsigned away everywhere possible.
https://github.com/llvm/llvm-project/pull/145170
More information about the Mlir-commits
mailing list