diff options
author | Nico Weber <thakis@chromium.org> | 2022-05-19 15:05:30 -0400 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2022-05-19 15:05:30 -0400 |
commit | 304a5a7a14dd26ae93194b336fef9a1213fa44b5 (patch) | |
tree | ea5f3930473ebe2db8693fa635d040a1ff8beaee /llvm/lib/Analysis/ValueTracking.cpp | |
parent | f613e6d19d293d4eff9885b1fb429162bc6700cd (diff) | |
download | llvm-304a5a7a14dd26ae93194b336fef9a1213fa44b5.zip llvm-304a5a7a14dd26ae93194b336fef9a1213fa44b5.tar.gz llvm-304a5a7a14dd26ae93194b336fef9a1213fa44b5.tar.bz2 |
Revert "[ValueTracking] Added support to deduce PHI Nodes values being a power of 2"
This reverts commit d5c130f17e503e128b8a413c2ce0e522987d2a16.
Breaks tests, see https://reviews.llvm.org/D125332#3525819
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 60dbfaa..a326335 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -2128,25 +2128,6 @@ bool isKnownToBeAPowerOfTwo(const Value *V, bool OrZero, unsigned Depth, } } - // A PHI node is power of two if all incoming values are power of two. - if (const PHINode *PN = dyn_cast<PHINode>(V)) { - Query RecQ = Q; - - // Recursively check all incoming values. Limit recursion to 2 levels, so - // that search complexity is limited to number of operands^2. - unsigned NewDepth = std::max(Depth, MaxAnalysisRecursionDepth - 1); - return llvm::all_of(PN->operands(), [&](const Use &U) { - // Value is power of 2 if it is coming from PHI node itself by induction. - if (U.get() == PN) - return true; - - // Change the context instruction to the incoming block where it is - // evaluated. - RecQ.CxtI = PN->getIncomingBlock(U)->getTerminator(); - return isKnownToBeAPowerOfTwo(U.get(), OrZero, NewDepth, RecQ); - }); - } - // An exact divide or right shift can only shift off zero bits, so the result // is a power of two only if the first operand is a power of two and not // copying a sign bit (sdiv int_min, 2). |