From f6c726472df1ebc8489e178a2d299cb3950efbfe Mon Sep 17 00:00:00 2001 From: Noah Goldstein Date: Mon, 7 Aug 2023 10:05:31 -0500 Subject: [PATCH] Revert "[ValueTracking] Improve the coverage of isKnownToBeAPowerOfTwo for vscale" Logic is incorrect. Shift can make non-zero pow2 zero. This reverts commit 9c837b7d0e2e2dffae804f3df49c4aeefe4743c0. --- llvm/lib/Analysis/ValueTracking.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 3198020c1a381..b350274645082 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);