https://github.com/qedawkins commented: Ok if this is in line with canonicalization of tensor.dim w.r.t. other ops then this makes sense. This wasn't immediately clear from the initial PR description. I'll bow out of the review here. https://github.com/llvm/llvm-project/pull/134219