[ValueTracking] Determine always-overflow condition for unsigned sub
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 28 Nov 2018 16:37:04 +0000 (16:37 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 28 Nov 2018 16:37:04 +0000 (16:37 +0000)
commitcf596a8c26ba08c473e567f2f8382602851fe1db
tree3cb600617f0bb0e987e8840002a96660d06eaf7d
parent78a9295e150190c5a4efe345d731cb78e037d28f
[ValueTracking] Determine always-overflow condition for unsigned sub

Always-overflow was already determined for unsigned addition, but
not subtraction. This patch establishes parity.

This allows us to perform some additional simplifications for
signed saturating subtractions.

This change is part of https://reviews.llvm.org/D54534.

llvm-svn: 347771
llvm/lib/Analysis/ValueTracking.cpp
llvm/test/Transforms/InstCombine/saturating-add-sub.ll