diff options
author | Nikita Popov <npopov@redhat.com> | 2023-05-24 10:52:18 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-05-24 10:54:10 +0200 |
commit | 92dc4fff87e46d262b7c40b31e2d3fb22211296d (patch) | |
tree | c2a34fbd29d3b38175fdf054d34305ec798fec8b /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 7c878f45040ec829713ff091470449b4b093b321 (diff) | |
download | llvm-92dc4fff87e46d262b7c40b31e2d3fb22211296d.zip llvm-92dc4fff87e46d262b7c40b31e2d3fb22211296d.tar.gz llvm-92dc4fff87e46d262b7c40b31e2d3fb22211296d.tar.bz2 |
[ValueTracking] Check for known bits conflict for shl nsw (PR62908)
I removed the conflict check from computeKnownBitsFromShiftOperator()
in D150648 assuming that this is now handled on the KnownBits side.
However, the nsw handling is still inside ValueTracking, so we
still need to handle conflicts there. Restore the check closer to
where it is relevant.
Fixes https://github.com/llvm/llvm-project/issues/62908.
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 5439419..90dbfcb 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -1363,6 +1363,8 @@ static void computeKnownBitsFromOperator(const Operator *I, Result.Zero.setSignBit(); if (KnownVal.One.isSignBitSet()) Result.One.setSignBit(); + if (Result.hasConflict()) + Result.setAllZero(); } return Result; }; |