[ValueTracking] Short-circuit computeKnownBitsAddSub(); NFCI
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 21 Mar 2020 11:14:53 +0000 (12:14 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 21 Mar 2020 12:42:10 +0000 (13:42 +0100)
commit7a62ea3889b94516f3886cec9e447f22b99856e3
tree71cc2f6406bba581867125f70c966e8758b1a0a5
parent9ab0c9a64402359647660cf1e3eca6006d375cf5
[ValueTracking] Short-circuit computeKnownBitsAddSub(); NFCI

If one operand is unknown (and we don't have nowrap), don't compute
the second operand.

Also don't create an unnecessary extra KnownBits variable, it's
okay to reuse KnownOut.

This reduces instructions on libclamav_md5.c by 40%.
llvm/lib/Analysis/ValueTracking.cpp