This patch makes optimizations in add/sub/div/rem in InstSimplify look through freeze.
For example, X - X => 0 can be expanded so X - freeze(X) and freeze(X) - X are also converted.
This is targeting a hypothetical case, not performance degradation that actually happened after D76483 is committed.
Proofs:
X + (Y - freeze(X)) -> Y
http://volta.cs.utah.edu:8080/z/yn2mcx
freeze(X) + (Y - X) -> Y
http://volta.cs.utah.edu:8080/z/EmNlwy
freeze(X) - X -> 0
http://volta.cs.utah.edu:8080/z/JVRhLa
freeze(X) div X -> 1, freeze(X) rem X -> 0
http://volta.cs.utah.edu:8080/z/5F6yCt
(X * freeze(Y)) / Y -> X
http://volta.cs.utah.edu:8080/z/MlbJgN
(X % freeze(Y)) / Y -> 0
http://volta.cs.utah.edu:8080/z/CQNyVN
clang-format: please reformat the code