[llvm] f6c7264 - Revert "[ValueTracking] Improve the coverage of isKnownToBeAPowerOfTwo for vscale"

Noah Goldstein via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 08:28:23 PDT 2023


Author: Noah Goldstein
Date: 2023-08-07T10:26:05-05:00
New Revision: f6c726472df1ebc8489e178a2d299cb3950efbfe

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

LOG: Revert "[ValueTracking] Improve the coverage of isKnownToBeAPowerOfTwo for vscale"

Logic is incorrect. Shift can make non-zero pow2 zero.

This reverts commit 9c837b7d0e2e2dffae804f3df49c4aeefe4743c0.

Added: 
    

Modified: 
    llvm/lib/Analysis/ValueTracking.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 3198020c1a3813..b3502746450825 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2020,8 +2020,7 @@ bool isKnownToBeAPowerOfTwo(const Value *V, bool OrZero, unsigned Depth,
   if (!I)
     return false;
 
-  if (Q.CxtI &&
-      (match(I, m_VScale()) || match(I, m_Shl(m_VScale(), m_Value())))) {
+  if (Q.CxtI && match(V, m_VScale())) {
     const Function *F = Q.CxtI->getFunction();
     // The vscale_range indicates vscale is a power-of-two.
     return F->hasFnAttribute(Attribute::VScaleRange);


        


More information about the llvm-commits mailing list