[Mlir-commits] [mlir] [mlir][tosa] Fold 'small' constant 1D slice	operations (PR #128193)
    Jack Frankland 
    llvmlistbot at llvm.org
       
    Thu Feb 27 07:10:55 PST 2025
    
    
  
================
@@ -21,3 +21,16 @@ func.func @try_fold_equal_with_unranked_tensor(%arg0: tensor<4xi32>, %arg1: tens
   %0 = tosa.equal %arg0, %arg1 : (tensor<4xi32>, tensor<1xi32>) -> tensor<*xi1>
   return
 }
+
----------------
FranklandJack wrote:
Could we add some negative tests here as well?
The condition for this transformation is:
```
  // Fold slice when all operands are constant and the output is 'small'
  // A 'small' output is currently defined as 1D and <= 6 elements
  // (tosa_level_8k MAX_RANK)
  ```
  
  So this suggests the following negative cases:
  1. 1 or more non-const operands
  2. Tensor of rank > 1 
  3. \> 6 element in extracted tensor.
https://github.com/llvm/llvm-project/pull/128193
    
    
More information about the Mlir-commits
mailing list