summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
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
commit7e335a763aeb291491ae5a0e97e3b4e57b688adc (patch)
tree256142c0fb6406cc64363c497e566dfba5b04051 /llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
parentff96dd0301af133735afcea0085fd67e5b10c7ad (diff)
downloadbcm5719-llvm-7e335a763aeb291491ae5a0e97e3b4e57b688adc.tar.gz
bcm5719-llvm-7e335a763aeb291491ae5a0e97e3b4e57b688adc.zip
Fix PR4206 - crash in simplify lib calls
llvm-svn: 71644
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index d53bc3f0ccc..8c41c728c06 100644
--- a/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ b/llvm/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");
OpenPOWER on IntegriCloud