[llvm-branch-commits] [llvm-branch] r71681 - in /llvm/branches/Apple/Dib: lib/Transforms/Scalar/SimplifyLibCalls.cpp test/Transforms/SimplifyLibCalls/FFS.ll
Bill Wendling
isanbard at gmail.com
Wed May 13 11:07:15 PDT 2009
Author: void
Date: Wed May 13 13:07:00 2009
New Revision: 71681
URL: http://llvm.org/viewvc/llvm-project?rev=71681&view=rev
Log:
--- Merging r71644 into '.':
U test/Transforms/SimplifyLibCalls/FFS.ll
U lib/Transforms/Scalar/SimplifyLibCalls.cpp
Fix PR4206 - crash in simplify lib calls
Modified:
llvm/branches/Apple/Dib/lib/Transforms/Scalar/SimplifyLibCalls.cpp
llvm/branches/Apple/Dib/test/Transforms/SimplifyLibCalls/FFS.ll
Modified: llvm/branches/Apple/Dib/lib/Transforms/Scalar/SimplifyLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=71681&r1=71680&r2=71681&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Transforms/Scalar/SimplifyLibCalls.cpp Wed May 13 13:07:00 2009
@@ -1116,7 +1116,7 @@
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");
Modified: llvm/branches/Apple/Dib/test/Transforms/SimplifyLibCalls/FFS.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/Transforms/SimplifyLibCalls/FFS.ll?rev=71681&r1=71680&r2=71681&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/test/Transforms/SimplifyLibCalls/FFS.ll (original)
+++ llvm/branches/Apple/Dib/test/Transforms/SimplifyLibCalls/FFS.ll Wed May 13 13:07:00 2009
@@ -28,3 +28,9 @@
ret i32 %rslt5
}
+
+; PR4206
+define i32 @a(i64) nounwind {
+ %2 = call i32 @ffsll(i64 %0) ; <i32> [#uses=1]
+ ret i32 %2
+}
More information about the llvm-branch-commits
mailing list