diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-02-25 06:52:48 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-02-25 06:52:48 +0000 |
commit | 20babb112c8d8aab89a5e86347e2bfdb90603ce8 (patch) | |
tree | 7ccad2be193a89824d6115987240ddef92c0ebf1 /lib | |
parent | 74c80df2b873bf388ed2e612f033fd95c32d15d8 (diff) | |
download | llvm-20babb112c8d8aab89a5e86347e2bfdb90603ce8.tar.gz llvm-20babb112c8d8aab89a5e86347e2bfdb90603ce8.tar.bz2 llvm-20babb112c8d8aab89a5e86347e2bfdb90603ce8.tar.xz |
Add a totally synthetic situation I came up with while looking at a bug in
related code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/README.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index 09e5433578..341c5c1ff4 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -1690,6 +1690,7 @@ 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); } @@ -1704,3 +1705,19 @@ 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. + +//===---------------------------------------------------------------------===// + |