diff --git a/src/jit/mlir.cpp b/src/jit/mlir.cpp index d84186e..cc3b2a5 100644 --- a/src/jit/mlir.cpp +++ b/src/jit/mlir.cpp @@ -679,6 +679,7 @@ static const std::string cpu_pipeline = "add-comm-cache-keys," "lower-distruntime-to-idtr," "convert-ndarray-to-linalg," + "cse," "canonicalize," "func.func(tosa-to-linalg)," "func.func(tosa-to-tensor)," @@ -688,6 +689,8 @@ static const std::string cpu_pipeline = "arith-expand," "memref-expand," "func.func(empty-tensor-to-alloc-tensor)," + "cse," + "canonicalize," "one-shot-bufferize," "canonicalize," "imex-remove-temporaries," diff --git a/test/test_manip.py b/test/test_manip.py index f2e6bcd..94630f2 100644 --- a/test/test_manip.py +++ b/test/test_manip.py @@ -33,6 +33,13 @@ def test_reshape_copy(self): assert numpy.allclose(sp.to_numpy(a), [20, 1, 2, 3, 4, 5, 6, 7]) assert numpy.allclose(sp.to_numpy(b), [[0, 1], [2, 3], [4, 5], [6, 7]]) + def test_view_assign(self): + a = sp.arange(0, 8, 1, sp.int32) + b = a[1:7] + b[0:4] = 22 + assert numpy.allclose(sp.to_numpy(a), [0, 22, 22, 22, 22, 5, 6, 7]) + assert numpy.allclose(sp.to_numpy(b), [22, 22, 22, 22, 5, 6]) + @pytest.mark.skipif(len(device), reason="FIXME 64bit on GPU") def test_astype_f64i32(self): def doit(aapi, **kwargs):