This is a continuation of D54237 for the subtraction case. The following simplifications / folds have been implemented:
- Constant folding sat(C1 - C2) -> C3
- sat(X - 0) -> X
- sat(X - X) -> 0
- sat(X - undef) -> 0
- sat(undef - X) -> 0
- sat(0 usub X) -> 0
- sat(X usub MAX) -> 0
- sat(sat(X - C1) - C2) -> sat(X + C3) where legal
- sat(X1 - X2) -> sub nuw/nsw where possible
I've also changed the computeOverflowForUnsignedSub() implementation to return AlwaysOverflows results, for parity with the computeOverflowForUnsignedAdd() implementation. The results were weirdly asymmetric previously.