[llvm] 71ac47f - [KnownBits] Make use of KnownBits.isUnknown. NFC.

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 01:22:01 PDT 2023


Author: Jay Foad
Date: 2023-05-16T09:19:55+01:00
New Revision: 71ac47f39120e77c7364799ca30cbd59b5caf5f7

URL: https://github.com/llvm/llvm-project/commit/71ac47f39120e77c7364799ca30cbd59b5caf5f7
DIFF: https://github.com/llvm/llvm-project/commit/71ac47f39120e77c7364799ca30cbd59b5caf5f7.diff

LOG: [KnownBits] Make use of KnownBits.isUnknown. NFC.

Added: 
    

Modified: 
    llvm/lib/Analysis/ValueTracking.cpp
    llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index ca02a9671c5e7..f46e9a3ddc191 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -1621,7 +1621,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
 
     // Otherwise take the unions of the known bit sets of the operands,
     // taking conservative care to avoid excessive recursion.
-    if (Depth < MaxAnalysisRecursionDepth - 1 && !Known.Zero && !Known.One) {
+    if (Depth < MaxAnalysisRecursionDepth - 1 && Known.isUnknown()) {
       // Skip if every incoming value references to ourself.
       if (isa_and_nonnull<UndefValue>(P->hasConstantValue()))
         break;

diff  --git a/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp b/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
index a33d59079acc8..776bf2729ea71 100644
--- a/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
@@ -238,7 +238,7 @@ void GISelKnownBits::computeKnownBitsImpl(Register R, KnownBits &Known,
         Known = KnownBits::commonBits(Known, Known2);
         // If we reach a point where we don't know anything
         // just stop looking through the operands.
-        if (Known.One == 0 && Known.Zero == 0)
+        if (Known.isUnknown())
           break;
       } else {
         // We know nothing.


        


More information about the llvm-commits mailing list