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

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 21:38:01 PDT 2024


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

close: #94436

>From 87a6753928eda38442bea5eaffe8f755f7c2a383 Mon Sep 17 00:00:00 2001
From: c8ef <c8ef at outlook.com>
Date: Thu, 6 Jun 2024 12:36:20 +0800
Subject: [PATCH] remove hasConflict() assertions

---
 llvm/include/llvm/Support/KnownBits.h | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/llvm/include/llvm/Support/KnownBits.h b/llvm/include/llvm/Support/KnownBits.h
index ba4a5f01036ca..c206bd77d5880 100644
--- a/llvm/include/llvm/Support/KnownBits.h
+++ b/llvm/include/llvm/Support/KnownBits.h
@@ -48,7 +48,6 @@ struct KnownBits {
 
   /// Returns true if we know the value of all bits.
   bool isConstant() const {
-    assert(!hasConflict() && "KnownBits conflict!");
     return Zero.popcount() + One.popcount() == getBitWidth();
   }
 
@@ -74,16 +73,10 @@ struct KnownBits {
   }
 
   /// Returns true if value is all zero.
-  bool isZero() const {
-    assert(!hasConflict() && "KnownBits conflict!");
-    return Zero.isAllOnes();
-  }
+  bool isZero() const { return Zero.isAllOnes(); }
 
   /// Returns true if value is all one bits.
-  bool isAllOnes() const {
-    assert(!hasConflict() && "KnownBits conflict!");
-    return One.isAllOnes();
-  }
+  bool isAllOnes() const { return One.isAllOnes(); }
 
   /// Make all bits known to be zero and discard any previous information.
   void setAllZero() {



More information about the llvm-commits mailing list