aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-02-01 08:50:33 +0000
committerDuncan Sands <baldrick@free.fr>2011-02-01 08:50:33 +0000
commit93c780288df9631d11f996b010b2212a8b44d4d3 (patch)
tree90e14a9e3f0a19c1bafd39d2e969ad0d34246875 /lib/Analysis
parent7681c6da606efcc392f76b8acea8301cb5fc7a0a (diff)
downloadexternal_llvm-93c780288df9631d11f996b010b2212a8b44d4d3.zip
external_llvm-93c780288df9631d11f996b010b2212a8b44d4d3.tar.gz
external_llvm-93c780288df9631d11f996b010b2212a8b44d4d3.tar.bz2
Add a m_SignBit pattern for convenience.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ValueTracking.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp
index 72b3f03..44c1b53 100644
--- a/lib/Analysis/ValueTracking.cpp
+++ b/lib/Analysis/ValueTracking.cpp
@@ -666,9 +666,7 @@ bool llvm::isPowerOfTwo(Value *V, const TargetData *TD, unsigned Depth) {
// (signbit) >>l X is clearly a power of two if the one is not shifted off the
// bottom. If it is shifted off the bottom then the result is undefined.
- ConstantInt *CI;
- if (match(V, m_LShr(m_ConstantInt(CI), m_Value())) &&
- CI->getValue().isSignBit())
+ if (match(V, m_LShr(m_SignBit(), m_Value())))
return true;
// The remaining tests are all recursive, so bail out if we hit the limit.