From 7bff244b8b9cf724ea66f7f59386fb2c16053681 Mon Sep 17 00:00:00 2001 From: Stephan Herhut Date: Tue, 4 Aug 2020 13:33:31 -0700 Subject: [PATCH] Allow index typed memrefs in reshape_memref_cast. With the recent change to allow memref of index in MLIR core, we should also allow this in the mhlo dialect. PiperOrigin-RevId: 324879354 --- include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td b/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td index 8708221..3fa4658 100644 --- a/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td +++ b/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td @@ -66,6 +66,8 @@ def LHLO_PredOrIntBuffer : MemRefOf<[HLO_Int, HLO_Pred]>; def LHLO_Buffer : MemRefOf<[AnyFloat, AnySignlessInteger, AnyComplex]>; +def LHLO_ExtentBuffer : MemRefRankOf<[AnySignlessInteger, Index], [1]>; + //===----------------------------------------------------------------------===// // LMHLO nullary op definitions. //===----------------------------------------------------------------------===// @@ -467,7 +469,7 @@ def ReshapeMemRefCastOp: Op:$shape + LHLO_ExtentBuffer:$shape ); let results = (outs AnyRankedOrUnrankedMemRef:$result);