aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-05-13 06:26:11 +0000
committerChris Lattner <sabre@nondot.org>2009-05-13 06:26:11 +0000
commit337011e9637f445f92fab538ac8031709197681d (patch)
tree763bb4f1ff1a7324c9d76e623bf1e62e6ab779d9 /lib/Transforms
parent52f7e149c0ba489dad202e2f21f1846380ec52cf (diff)
downloadexternal_llvm-337011e9637f445f92fab538ac8031709197681d.zip
external_llvm-337011e9637f445f92fab538ac8031709197681d.tar.gz
external_llvm-337011e9637f445f92fab538ac8031709197681d.tar.bz2
Fix PR4206 - crash in simplify lib calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/SimplifyLibCalls.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index d53bc3f..8c41c72 100644
--- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
@@ -1116,7 +1116,7 @@ struct VISIBILITY_HIDDEN FFSOpt : public LibCallOptimization {
Value *F = Intrinsic::getDeclaration(Callee->getParent(),
Intrinsic::cttz, &ArgType, 1);
Value *V = B.CreateCall(F, Op, "cttz");
- V = B.CreateAdd(V, ConstantInt::get(Type::Int32Ty, 1), "tmp");
+ V = B.CreateAdd(V, ConstantInt::get(V->getType(), 1), "tmp");
V = B.CreateIntCast(V, Type::Int32Ty, false, "tmp");
Value *Cond = B.CreateICmpNE(Op, Constant::getNullValue(ArgType), "tmp");