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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 06:57:02 PDT 2024


================
@@ -726,6 +741,9 @@ TEST(KnownBitsTest, SExtInReg) {
   unsigned Bits = 4;
   for (unsigned FromBits = 1; FromBits <= Bits; ++FromBits) {
     ForeachKnownBits(Bits, [&](const KnownBits &Known) {
+      if (Known.hasConflict())
+        return;
----------------
nikic wrote:

I think it would be slightly better to move this check until after the Known.sextInReg() call (and also something similar for the other tests). Basically still call the KnownBits helper to make sure it doesn't assert, but don't check what the result will be, as it could be anything.

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


More information about the llvm-commits mailing list