From 2c4efe68ea698878f4041e7d8a335c01d8db2bbd Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 4 Dec 2008 09:05:45 +0000 Subject: [PATCH] Mention an optimization opportunity pointed out by Chris. llvm-svn: 60535 --- clang/lib/CodeGen/README.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/clang/lib/CodeGen/README.txt b/clang/lib/CodeGen/README.txt index cda17ea97fc8..56069dd99d29 100644 --- a/clang/lib/CodeGen/README.txt +++ b/clang/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. + +//===---------------------------------------------------------------------===// +