llvm-project
bbcab0bf - [InstCombine] Fix i1 ssub.sat compare folding (#173742)

Commit
99 days ago
[InstCombine] Fix i1 ssub.sat compare folding (#173742) For every type other than i1, ssub.sat x, y = 0 implies x == y. But ssub.sat.i1 0, -1 = 0 (because the result of 1 saturates to 0). The changes to instcombine are not strictly necessary. Instcombine canonicalizes the ssub.sat.i1 before we arrive at these pattern-matches. The real fix is in ValueTracking. Nonetheless we agreed in review it makes sense to add these checks to instcombine, even though they're currently unreachable: https://github.com/llvm/llvm-project/pull/173742#issuecomment-3696631396 This was found by a fuzzer I'm working on!
Author
Parents
Loading