[llvm] [KnownBits] Remove `hasConflict()` assertions (PR #94568)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 02:37:42 PDT 2024


================
@@ -403,8 +391,7 @@ KnownBits KnownBits::lshr(const KnownBits &LHS, const KnownBits &RHS,
   if (Exact) {
     unsigned FirstOne = LHS.countMaxTrailingZeros();
     if (FirstOne < MinShiftAmount) {
-      // Always poison. Return zero because we don't like returning conflict.
-      Known.setAllZero();
+      // Always poison.
----------------
nikic wrote:

Similar here and in the ashr implementation. We go from returning zero to returning unknown, which is responsible for the regressions in SCEV tests where we go from range `[0, 1)` to `full-set`.

The correct replacement would be something like setConflict(), but given that we don't have that yet and wouldn't be able to make use of it for folding I think it's best to leave these cases alone.

https://github.com/llvm/llvm-project/pull/94568


More information about the llvm-commits mailing list