[llvm-commits] [llvm] r92084 - /llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp
Chris Lattner
sabre at nondot.org
Wed Dec 23 15:24:51 PST 2009
Author: lattner
Date: Wed Dec 23 17:24:51 2009
New Revision: 92084
URL: http://llvm.org/viewvc/llvm-project?rev=92084&view=rev
Log:
reorder to follow a normal fall-through style, no functionality change.
Modified:
llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp?rev=92084&r1=92083&r2=92084&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Wed Dec 23 17:24:51 2009
@@ -905,12 +905,11 @@
if (uint64_t Len = GetStringLength(Src))
return ConstantInt::get(CI->getType(), Len-1);
- // Handle strlen(p) != 0.
- if (!IsOnlyUsedInZeroEqualityComparison(CI)) return 0;
-
// strlen(x) != 0 --> *x != 0
// strlen(x) == 0 --> *x == 0
- return B.CreateZExt(B.CreateLoad(Src, "strlenfirst"), CI->getType());
+ if (IsOnlyUsedInZeroEqualityComparison(CI))
+ return B.CreateZExt(B.CreateLoad(Src, "strlenfirst"), CI->getType());
+ return 0;
}
};
More information about the llvm-commits
mailing list