[Mlir-commits] [mlir] Let `memref.{expand, collapse}_shape` implement `ReifyRankedShapedTypeOpInterface` (PR #89111)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Thu Apr 18 00:54:25 PDT 2024


================
@@ -2079,6 +2080,95 @@ void ExpandShapeOp::getAsmResultNames(
   setNameFn(getResult(), "expand_shape");
 }
 
+LogicalResult ExpandShapeOp::reifyResultShapes(
+    OpBuilder &builder, ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
+  SmallVector<OpFoldResult> resultDims;
+  ArrayRef<int64_t> expandedShape = this->getResultType().getShape();
+  for (size_t expanded_dim = 0; expanded_dim < expandedShape.size();
----------------
ftynse wrote:

https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop, here and below.

https://github.com/llvm/llvm-project/pull/89111


More information about the Mlir-commits mailing list