[llvm] r304771 - [ValueTracking] Use APInt::intersects to avoid some temporary APInts. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 00:13:09 PDT 2017


Author: ctopper
Date: Tue Jun  6 02:13:09 2017
New Revision: 304771

URL: http://llvm.org/viewvc/llvm-project?rev=304771&view=rev
Log:
[ValueTracking] Use APInt::intersects to avoid some temporary APInts. NFC

Modified:
    llvm/trunk/lib/Analysis/ValueTracking.cpp

Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=304771&r1=304770&r2=304771&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Tue Jun  6 02:13:09 2017
@@ -1999,9 +1999,8 @@ static bool isKnownNonEqual(const Value
     KnownBits Known2(BitWidth);
     computeKnownBits(V2, Known2, 0, Q);
 
-    APInt OppositeBits = (Known1.Zero & Known2.One) |
-                         (Known2.Zero & Known1.One);
-    if (OppositeBits.getBoolValue())
+    if (Known1.Zero.intersects(Known2.One) ||
+        Known2.Zero.intersects(Known1.One))
       return true;
   }
   return false;




More information about the llvm-commits mailing list