newling wrote: What about having a pattern in the lowering that insert a shape_cast (N-D -> 1-D) before, will the resulting IR be worse? If so does that mean shape_cast lowering needs improvement? https://github.com/llvm/llvm-project/pull/151175