[llvm-commits] [llvm] r98663 - /llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp
Benjamin Kramer
benny.kra at googlemail.com
Tue Mar 16 12:36:43 PDT 2010
Author: d0k
Date: Tue Mar 16 14:36:43 2010
New Revision: 98663
URL: http://llvm.org/viewvc/llvm-project?rev=98663&view=rev
Log:
Mark str[r]chr readonly.
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=98663&r1=98662&r2=98663&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimplifyLibCalls.cpp Tue Mar 16 14:36:43 2010
@@ -1400,6 +1400,15 @@
setOnlyReadsMemory(F);
setDoesNotThrow(F);
setDoesNotCapture(F, 1);
+ } else if (Name == "strchr" ||
+ Name == "strrchr") {
+ if (FTy->getNumParams() != 2 ||
+ !FTy->getParamType(0)->isPointerTy() ||
+ !FTy->getParamType(1)->isIntegerTy())
+ continue;
+ setOnlyReadsMemory(F);
+ setDoesNotThrow(F);
+ setDoesNotCapture(F, 1);
} else if (Name == "strcpy" ||
Name == "stpcpy" ||
Name == "strcat" ||
@@ -1428,7 +1437,7 @@
} else if (Name == "strcmp" ||
Name == "strspn" ||
Name == "strncmp" ||
- Name ==" strcspn" ||
+ Name == "strcspn" ||
Name == "strcoll" ||
Name == "strcasecmp" ||
Name == "strncasecmp") {
More information about the llvm-commits
mailing list