diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-20 12:57:15 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-20 18:16:05 +0100 |
commit | 3205d1a860367f7ab77d331f03086eeed194e44c (patch) | |
tree | db61923479733d466d3cb0ac965cc22f3d1accda /llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | |
parent | 0b18b568e91a3ebe3ab33d13328a1614fb94cf07 (diff) | |
download | llvm-3205d1a860367f7ab77d331f03086eeed194e44c.zip llvm-3205d1a860367f7ab77d331f03086eeed194e44c.tar.gz llvm-3205d1a860367f7ab77d331f03086eeed194e44c.tar.bz2 |
[InstCombine] Handle known shl nsw sign bit in SimplifyDemanded
Ideally SimplifyDemanded should compute the same known bits as
computeKnownBits(). This patch addresses one discrepancy, where
ValueTracking is more powerful: If we have a shl nsw shift, we
know that the sign bit of the input and output must be the same.
If this results in a conflict, the result is poison.
This is implemented in
https://github.com/llvm-mirror/llvm/blob/2c4ca6832fa6b306ee6a7010bfb80a3f2596f824/lib/Analysis/ValueTracking.cpp#L1175-L1179
and
https://github.com/llvm-mirror/llvm/blob/2c4ca6832fa6b306ee6a7010bfb80a3f2596f824/lib/Analysis/ValueTracking.cpp#L904-L908.
This implements the same basic logic in SimplifyDemanded. It's
slightly stronger, because I return undef instead of zero for the
poison case (which is not an option inside ValueTracking).
As mentioned in https://reviews.llvm.org/D75801#inline-698484,
we could detect poison in more cases, this just establishes parity
with the existing logic.
Differential Revision: https://reviews.llvm.org/D76489
Diffstat (limited to 'llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions