From 4b397fcdc20aae16f4af2d2636137002fa86b023 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 1 Feb 2011 08:50:33 +0000 Subject: Add a m_SignBit pattern for convenience. llvm-svn: 124656 --- llvm/lib/Analysis/ValueTracking.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/Analysis') diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 72b3f03a93a..44c1b5326bc 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/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. -- cgit v1.2.3