diff options
author | Chris Lattner <sabre@nondot.org> | 2009-05-13 06:26:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-05-13 06:26:11 +0000 |
commit | bcc2e7dc2c4d10e5b5ecab2e1201653508a3b1ef (patch) | |
tree | 763bb4f1ff1a7324c9d76e623bf1e62e6ab779d9 /lib/Transforms/Scalar/SimplifyLibCalls.cpp | |
parent | 60dc7345eb1543546064a35c7c2c4ea08b40f9c0 (diff) | |
download | external_llvm-bcc2e7dc2c4d10e5b5ecab2e1201653508a3b1ef.zip external_llvm-bcc2e7dc2c4d10e5b5ecab2e1201653508a3b1ef.tar.gz external_llvm-bcc2e7dc2c4d10e5b5ecab2e1201653508a3b1ef.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/Scalar/SimplifyLibCalls.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SimplifyLibCalls.cpp | 2 |
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"); |