https://github.com/frasercrmck commented: The PR description needs updating to reflect some of the new changes - the conditions under which the optimization is legal/performed, and that some instructions are being removed. https://github.com/llvm/llvm-project/pull/114977