Skip to content

Commit 959b8aa

Browse files
authored
[MLIR][NFC] Expose computeProduct function. (#135192)
Make it non-static, as its functionality is quite generic.
1 parent 378ac57 commit 959b8aa

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

mlir/include/mlir/Dialect/Affine/IR/AffineOps.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ Region *getAffineScope(Operation *op);
5353
/// analysis scope.
5454
Region *getAffineAnalysisScope(Operation *op);
5555

56+
/// Return the product of `terms`, creating an `affine.apply` if any of them are
57+
/// non-constant values. If any of `terms` is `nullptr`, return `nullptr`.
58+
OpFoldResult computeProduct(Location loc, OpBuilder &builder,
59+
ArrayRef<OpFoldResult> terms);
60+
5661
/// AffineDmaStartOp starts a non-blocking DMA operation that transfers data
5762
/// from a source memref to a destination memref. The source and destination
5863
/// memref need not be of the same dimensionality, but need to have the same

mlir/lib/Dialect/Affine/IR/AffineOps.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5081,10 +5081,8 @@ struct DropLinearizeUnitComponentsIfDisjointOrZero final
50815081
}
50825082
};
50835083

5084-
/// Return the product of `terms`, creating an `affine.apply` if any of them are
5085-
/// non-constant values. If any of `terms` is `nullptr`, return `nullptr`.
5086-
static OpFoldResult computeProduct(Location loc, OpBuilder &builder,
5087-
ArrayRef<OpFoldResult> terms) {
5084+
OpFoldResult computeProduct(Location loc, OpBuilder &builder,
5085+
ArrayRef<OpFoldResult> terms) {
50885086
int64_t nDynamic = 0;
50895087
SmallVector<Value> dynamicPart;
50905088
AffineExpr result = builder.getAffineConstantExpr(1);

0 commit comments

Comments
 (0)