https://github.com/matthias-springer commented: I don't see a problem with this PR, but I'm not working with collapse_shape/expand_shape anymore. @MaheshRavishankar is this safe to merge? https://github.com/llvm/llvm-project/pull/157330