https://github.com/lukel97 approved this pull request. Ah I see what you mean about having a possibly non-constant arg. In that case I think having it in InstSimplify is fine. LGTM but please wait for another reviewer https://github.com/llvm/llvm-project/pull/146750