summaryrefslogtreecommitdiff
path: root/lib/Target/README.txt
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-05-11 17:36:33 +0000
committerChris Lattner <sabre@nondot.org>2009-05-11 17:36:33 +0000
commitd919a8bc8a81068f343ba4c0c37591c52282950e (patch)
tree4aebc2da5f1a7643bd473bf511d00258e675db0a /lib/Target/README.txt
parentc1acc3f764804d25f70d88f937ef9c460143e0f1 (diff)
downloadllvm-d919a8bc8a81068f343ba4c0c37591c52282950e.tar.gz
llvm-d919a8bc8a81068f343ba4c0c37591c52282950e.tar.bz2
llvm-d919a8bc8a81068f343ba4c0c37591c52282950e.tar.xz
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/README.txt')
-rw-r--r--lib/Target/README.txt35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index 2af2d61a6c..1c33f3946d 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -1717,3 +1717,38 @@ int int_char(char m) {if(m>7) return 0; return m;}
//===---------------------------------------------------------------------===//
+InstCombine's "turn load from constant into constant" optimization should be
+more aggressive in the presence of bitcasts. For example, because of unions,
+this code:
+
+union vec2d {
+ double e[2];
+ double v __attribute__((vector_size(16)));
+};
+typedef union vec2d vec2d;
+
+static vec2d a={{1,2}}, b={{3,4}};
+
+vec2d foo () {
+ return (vec2d){ .v = a.v + b.v * (vec2d){{5,5}}.v };
+}
+
+Compiles into:
+
+@a = internal constant %0 { [2 x double]
+ [double 1.000000e+00, double 2.000000e+00] }, align 16
+@b = internal constant %0 { [2 x double]
+ [double 3.000000e+00, double 4.000000e+00] }, align 16
+...
+define void @foo(%struct.vec2d* noalias nocapture sret %agg.result) nounwind {
+entry:
+ %0 = load <2 x double>* getelementptr (%struct.vec2d*
+ bitcast (%0* @a to %struct.vec2d*), i32 0, i32 0), align 16
+ %1 = load <2 x double>* getelementptr (%struct.vec2d*
+ bitcast (%0* @b to %struct.vec2d*), i32 0, i32 0), align 16
+
+
+Instcombine should be able to optimize away the loads (and thus the globals).
+
+
+//===---------------------------------------------------------------------===//