This is one of the IR transforms suggested in issue #57255.
https://godbolt.org/z/P9rMGhTcE.
Now we already support to transform t*5 + t into t * (5+1), but not for t - 1 + 5 * t
so the patch try logic: (t-1)+(5*t) -> (t*5)+(t-1) -> (t*5+t)-1 = t*(5+1)-1
Depend D132412
Make formatting changes independently of this patch or just leave it unchanged.