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

Nick Lewycky nicholas at mxc.ca
Tue Feb 24 22:52:48 PST 2009


Author: nicholas
Date: Wed Feb 25 00:52:48 2009
New Revision: 65437

URL: http://llvm.org/viewvc/llvm-project?rev=65437&view=rev
Log:
Add a totally synthetic situation I came up with while looking at a bug in
related code.

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=65437&r1=65436&r2=65437&view=diff

==============================================================================
--- llvm/trunk/lib/Target/README.txt (original)
+++ llvm/trunk/lib/Target/README.txt Wed Feb 25 00:52:48 2009
@@ -1690,6 +1690,7 @@
 the float directly.
 
 //===---------------------------------------------------------------------===//
+
 #include <math.h>
 double foo(double a) {    return sin(a); }
 
@@ -1704,3 +1705,19 @@
 foo:
         jmp sin
 
+//===---------------------------------------------------------------------===//
+
+Instcombine should replace the load with a constant in:
+
+  static const char x[4] = {'a', 'b', 'c', 'd'};
+  
+  unsigned int y(void) {
+    return *(unsigned int *)x;
+  }
+
+It currently only does this transformation when the size of the constant 
+is the same as the size of the integer (so, try x[5]) and the last byte 
+is a null (making it a C string). There's no need for these restrictions.
+
+//===---------------------------------------------------------------------===//
+





More information about the llvm-commits mailing list