summaryrefslogtreecommitdiff
path: root/lib/Target/README.txt
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-01-07 20:42:20 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-01-07 20:42:20 +0000
commiteaff66a8950bb9ed76e830c4ded7e0b695ab6904 (patch)
tree83dd056fee7b677e7af5b72f924bf2e2930c5c8b /lib/Target/README.txt
parent53bf3ee82ba9fb6e6008b9752d4f8f4e71a4bfe4 (diff)
downloadllvm-eaff66a8950bb9ed76e830c4ded7e0b695ab6904.tar.gz
llvm-eaff66a8950bb9ed76e830c4ded7e0b695ab6904.tar.bz2
llvm-eaff66a8950bb9ed76e830c4ded7e0b695ab6904.tar.xz
Revert 122959, it needs more thought. Add it back to README.txt with additional notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/README.txt')
-rw-r--r--lib/Target/README.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index d13ea736a1..5cc4fe027a 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -2009,6 +2009,28 @@ entry:
//===---------------------------------------------------------------------===//
+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.
+
+Note that this would change the semantics of @llvm.objectsize which by its
+current definition always folds to a constant. We also should make sure that
+we remove checking in code like
+
+ char *p = malloc(strlen(s)+1);
+ __strcpy_chk(p, s, __builtin_objectsize(p, 0));
+
+//===---------------------------------------------------------------------===//
+
This code (from Benchmarks/Dhrystone/dry.c):
define i32 @Func1(i32, i32) nounwind readnone optsize ssp {