aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2023-08-07 10:05:31 -0500
committerNoah Goldstein <goldstein.w.n@gmail.com>2023-08-07 10:26:05 -0500
commitf6c726472df1ebc8489e178a2d299cb3950efbfe (patch)
tree5c2cd9febb1a53adcfb9c5136284a961ded14a75
parent5de89b4d99c913e3c7c2735886f2519a2ed39d8a (diff)
downloadllvm-f6c726472df1ebc8489e178a2d299cb3950efbfe.zip
llvm-f6c726472df1ebc8489e178a2d299cb3950efbfe.tar.gz
llvm-f6c726472df1ebc8489e178a2d299cb3950efbfe.tar.bz2
Revert "[ValueTracking] Improve the coverage of isKnownToBeAPowerOfTwo for vscale"
Logic is incorrect. Shift can make non-zero pow2 zero. This reverts commit 9c837b7d0e2e2dffae804f3df49c4aeefe4743c0.
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 3198020..b350274 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);