summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Analysis/ValueTracking.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp
index 2fe60907fb..67e4aad4fd 100644
--- a/lib/Analysis/ValueTracking.cpp
+++ b/lib/Analysis/ValueTracking.cpp
@@ -565,12 +565,9 @@ unsigned llvm::ComputeNumSignBits(Value *V, TargetData *TD, unsigned Depth) {
unsigned Tmp, Tmp2;
unsigned FirstAnswer = 1;
- if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
- if (CI->getValue().isNegative())
- return CI->getValue().countLeadingOnes();
- return CI->getValue().countLeadingZeros();
- }
-
+ // Note that ConstantInt is handled by the general ComputeMaskedBits case
+ // below.
+
if (Depth == 6)
return 1; // Limit search depth.