[PATCH] D157313: [ValueTracking] Check likely to be canonicalized constant operands first in ; NFC

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 12:46:17 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG035aaae45cf4: [ValueTracking] Check likely to be canonicalized constant operands first in… (authored by goldstein.w.n).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157313/new/

https://reviews.llvm.org/D157313

Files:
  llvm/lib/Analysis/ValueTracking.cpp


Index: llvm/lib/Analysis/ValueTracking.cpp
===================================================================
--- llvm/lib/Analysis/ValueTracking.cpp
+++ llvm/lib/Analysis/ValueTracking.cpp
@@ -2061,8 +2061,8 @@
   case Instruction::And:
     if (OrZero) {
       // A power of two and'd with anything is a power of two or zero.
-      if (isKnownToBeAPowerOfTwo(I->getOperand(0), /*OrZero*/ true, Depth, Q) ||
-          isKnownToBeAPowerOfTwo(I->getOperand(1), /*OrZero*/ true, Depth, Q))
+      if (isKnownToBeAPowerOfTwo(I->getOperand(1), /*OrZero*/ true, Depth, Q) ||
+          isKnownToBeAPowerOfTwo(I->getOperand(0), /*OrZero*/ true, Depth, Q))
         return true;
       // X & (-X) is always a power of two or zero.
       if (match(I->getOperand(0), m_Neg(m_Specific(I->getOperand(1)))) ||


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157313.548748.patch
Type: text/x-patch
Size: 804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230809/c0c39bc7/attachment.bin>


More information about the llvm-commits mailing list