[Mlir-commits] [mlir] [mlir][tosa] Check for 0-ranked-tensors during fold (PR #68512)

Georgios Pinitas llvmlistbot at llvm.org
Tue Oct 10 03:50:44 PDT 2023


================
@@ -874,7 +874,8 @@ OpFoldResult ReverseOp::fold(FoldAdaptor adaptor) {
     return operandAttr;
 
   // If the dim-length is 1, tosa.reverse is a no-op.
-  if (operandTy.hasRank() && operandTy.getDimSize(axis) == 1)
+  if (operandTy.hasRank() && operandTy.getRank() != 0 &&
----------------
GeorgeARM wrote:

Should rank-0 tensors get folded as well?

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


More information about the Mlir-commits mailing list