[ConstantFolding] Fixing addo/subo with undef
authorGeorge Mitenkov <georgemitenk0v@gmail.com>
Wed, 31 Mar 2021 18:46:28 +0000 (21:46 +0300)
committerGeorge Mitenkov <georgemitenk0v@gmail.com>
Wed, 31 Mar 2021 18:47:29 +0000 (21:47 +0300)
commit807b019ca292e53cc40cc76c1f0efd8a7b2efe62
tree525e5c860060a87deb7754bb00bd3c20e1163281
parent10847f6217b159e01b72a34eb366a543ca612aa6
[ConstantFolding] Fixing addo/subo with undef

When folding addo/subo with undef, the current
convention is to use { -1, false } for addo and
{ 0, false } for subo. This was fixed for InstSimplify in
https://reviews.llvm.org/rGf094d65beaa492e845b03561eddd75b5be653a01,
but not in ConstantFolding.

Reviewed By: nikic, lebedev.ri

Differential Revision: https://reviews.llvm.org/D99564
llvm/lib/Analysis/ConstantFolding.cpp
llvm/test/Transforms/InstSimplify/ConstProp/overflow-ops.ll