Skip to content

Commit

Permalink
Revert "[ValueTracking] Improve the coverage of isKnownToBeAPowerOfTw…
Browse files Browse the repository at this point in the history
…o for vscale"

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

This reverts commit 9c837b7.
  • Loading branch information
goldsteinn committed Aug 7, 2023
1 parent 5de89b4 commit f6c7264
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/Analysis/ValueTracking.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit f6c7264

Please sign in to comment.