[llvm-commits] [llvm] r104404 - /llvm/trunk/lib/Target/README.txt

Chris Lattner sabre at nondot.org
Fri May 21 16:16:21 PDT 2010


Author: lattner
Date: Fri May 21 18:16:21 2010
New Revision: 104404

URL: http://llvm.org/viewvc/llvm-project?rev=104404&view=rev
Log:
add a note

Modified:
    llvm/trunk/lib/Target/README.txt

Modified: llvm/trunk/lib/Target/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/README.txt?rev=104404&r1=104403&r2=104404&view=diff
==============================================================================
--- llvm/trunk/lib/Target/README.txt (original)
+++ llvm/trunk/lib/Target/README.txt Fri May 21 18:16:21 2010
@@ -1833,6 +1833,21 @@
 We should use DSE + llvm.lifetime.end to delete dead vtable pointer updates.
 See GCC PR34949
 
+Another interesting case is that something related could be used for variables
+that go const after their ctor has finished.  In these cases, globalopt (which
+can statically run the constructor) could mark the global const (so it gets put
+in the readonly section).  A testcase would be:
+
+#include <complex>
+using namespace std;
+const complex<char> should_be_in_rodata (42,-42);
+complex<char> should_be_in_data (42,-42);
+complex<char> should_be_in_bss;
+
+Where we currently evaluate the ctors but the globals don't become const because
+the optimizer doesn't know they "become const" after the ctor is done.  See
+GCC PR4131 for more examples.
+
 //===---------------------------------------------------------------------===//
 
 In this code:





More information about the llvm-commits mailing list