1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

reorder to follow a normal fall-through style, no functionality change.

llvm-svn: 92084
This commit is contained in:
Chris Lattner 2009-12-23 23:24:51 +00:00
parent 9c8c8af11d
commit 7dbb93e430

View File

@ -905,12 +905,11 @@ struct StrLenOpt : public LibCallOptimization {
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;
}
};