a missed __builtin_object_size case.
authorChris Lattner <sabre@nondot.org>
Sat, 1 Jan 2011 22:57:31 +0000 (22:57 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 1 Jan 2011 22:57:31 +0000 (22:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122676 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/README.txt

index be0e6bb82e4490766314171d7720adea9907539b..4e374e59d6dbf1c5f5d68042a06c8f2aad88cc10 100644 (file)
@@ -2074,3 +2074,20 @@ define i1 @g(i32 a) nounwind readnone {
 }
 
 //===---------------------------------------------------------------------===//
+
+This code can be seen in viterbi:
+
+  %64 = call noalias i8* @malloc(i64 %62) nounwind
+...
+  %67 = call i64 @llvm.objectsize.i64(i8* %64, i1 false) nounwind
+  %68 = call i8* @__memset_chk(i8* %64, i32 0, i64 %62, i64 %67) nounwind
+
+llvm.objectsize.i64 should be taught about malloc/calloc, allowing it to
+fold to %62.  This is a security win (overflows of malloc will get caught)
+and also a performance win by exposing more memsets to the optimizer.
+
+This occurs several times in viterbi.
+
+//===---------------------------------------------------------------------===//
+
+