Introduce a new technique for merging BasicBlock with Instruction sentinel by superpo...
[oota-llvm.git] / lib / Target / README.txt
index 78dcb12581c699ff3271d73fce612b6d8ca5b386..341c5c1ff472f9f683fbc87384b4a44b9b0a2bc1 100644 (file)
@@ -1689,3 +1689,35 @@ for next field in struct (which is at same address).
 For example: store of float into { {{}}, float } could be turned into a store to
 the float directly.
 
+//===---------------------------------------------------------------------===//
+
+#include <math.h>
+double foo(double a) {    return sin(a); }
+
+This compiles into this on x86-64 Linux:
+foo:
+       subq    $8, %rsp
+       call    sin
+       addq    $8, %rsp
+       ret
+vs:
+
+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.
+
+//===---------------------------------------------------------------------===//
+