]> granicus.if.org Git - clang/commitdiff
Mention an optimization opportunity pointed out by Chris.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 4 Dec 2008 09:05:45 +0000 (09:05 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 4 Dec 2008 09:05:45 +0000 (09:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60535 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/README.txt

index cda17ea97fc802b33eafb6e2ecd4809ad7b13e69..56069dd99d2983b7cbf638a51eb79e8514cd6c0a 100644 (file)
@@ -18,3 +18,15 @@ directly.
 
 //===---------------------------------------------------------------------===//
 
+It may be worth avoiding creation of alloca's for formal arguments
+for the common situation where the argument is never written to or has
+its address taken. The idea would be to begin generating code by using
+the argument directly and if its address is taken or it is stored to
+then generate the alloca and patch up the existing code.
+
+In theory, the same optimization could be a win for block local
+variables as long as the declaration dominates all statements in the
+block.
+
+//===---------------------------------------------------------------------===//
+