diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp --- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp +++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp @@ -629,9 +629,9 @@ MLIRContext *ctx = map->getContext(); AffineExpr toReplace = isDimReplacement ? getAffineDimExpr(pos, ctx) : getAffineSymbolExpr(pos, ctx); - *map = map->replace(toReplace, composeExpr, dims.size(), syms.size()); dims.append(composeDims.begin(), composeDims.end()); syms.append(composeSyms.begin(), composeSyms.end()); + *map = map->replace(toReplace, composeExpr, dims.size(), syms.size()); return success(); }