aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-12 22:49:11 +0000
committerChris Lattner <sabre@nondot.org>2007-01-12 22:49:11 +0000
commit720922fe27379301ff398d05b1f6214a6483b030 (patch)
tree9fcc4d6e81405520165edf0b7fbc9c5c29593965
parentfa30182eb84ee70d9f52120d653d63374b99cee6 (diff)
Remove over-general comparisons
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33147 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/IPO/SimplifyLibCalls.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/SimplifyLibCalls.cpp b/lib/Transforms/IPO/SimplifyLibCalls.cpp
index 70821f8f90..db0c492f72 100644
--- a/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -1823,14 +1823,16 @@ public:
assert(ArgType->getTypeID() == Type::IntegerTyID &&
"llvm.cttz argument is not an integer?");
unsigned BitWidth = cast<IntegerType>(ArgType)->getBitWidth();
- if (BitWidth <= 8)
+ if (BitWidth == 8)
CTTZName = "llvm.cttz.i8";
- else if (BitWidth <= 16)
+ else if (BitWidth == 16)
CTTZName = "llvm.cttz.i16";
- else if (BitWidth <= 32)
+ else if (BitWidth == 32)
CTTZName = "llvm.cttz.i32";
- else
+ else {
+ assert(BitWidth == 64 && "Unknown bitwidth");
CTTZName = "llvm.cttz.i64";
+ }
Constant *F = SLC.getModule()->getOrInsertFunction(CTTZName, ArgType,
ArgType, NULL);