From 6c3fc0a52d75b9792c85ba88c4d6d30d568455db Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 1 Jan 2011 22:57:31 +0000 Subject: [PATCH] a missed __builtin_object_size case. llvm-svn: 122676 --- llvm/lib/Target/README.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt index be0e6bb82e44..4e374e59d6db 100644 --- a/llvm/lib/Target/README.txt +++ b/llvm/lib/Target/README.txt @@ -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. + +//===---------------------------------------------------------------------===// + +