[ValueTracking] Don't set nsw flag for inbounds addition
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 2 Nov 2020 18:08:37 +0000 (19:08 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 13 Nov 2020 16:58:21 +0000 (17:58 +0100)
commit92b708902e1db30a976e168111be5bbe81ee8191
tree42100e1d1fc31668c86a5788ef8ef23ec750197e
parente56eea26cad153f4b26df8b5d4c295e10cb47de5
[ValueTracking] Don't set nsw flag for inbounds addition

When computing the known bits for a GEP, don't set the nsw flag
when adding an offset to an address. The nsw flag only applies to
pure offset additions (see also D90708).

The nsw flag is only used in a very minor way by the code, to the
point that I was not able to come up with a test case where it
makes a difference.

Differential Revision: https://reviews.llvm.org/D90637
llvm/lib/Analysis/ValueTracking.cpp