From: Daniel Dunbar Date: Thu, 4 Dec 2008 09:05:45 +0000 (+0000) Subject: Mention an optimization opportunity pointed out by Chris. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86ccea05f6bab8956f5418cdc4df8e130d4422aa;p=clang Mention an optimization opportunity pointed out by Chris. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60535 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/README.txt b/lib/CodeGen/README.txt index cda17ea97f..56069dd99d 100644 --- a/lib/CodeGen/README.txt +++ b/lib/CodeGen/README.txt @@ -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. + +//===---------------------------------------------------------------------===// +