Issue: #59196 https://alive2.llvm.org/ce/z/Li-Eqq
This looks right, but it is incomplete - it does not handle the commuted pattern? D138700 says it handles this and more, so let's proceed with that patch. @bcl5980 - a vector test as shown here would be a good addition.
Let's proceed with D138700. I abandon this patch