summaryrefslogtreecommitdiff
path: root/lib/Target/README.txt
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-01-18 22:36:59 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-01-18 22:36:59 +0000
commit9cfb3adf44e14cca2b32c447b36574ef82a7aa6b (patch)
treecd119aa6aab221cf410369c441eb865f28f592b1 /lib/Target/README.txt
parent48814681d72242e0179d7100f263952fdf4f51d6 (diff)
downloadllvm-9cfb3adf44e14cca2b32c447b36574ef82a7aa6b.tar.gz
llvm-9cfb3adf44e14cca2b32c447b36574ef82a7aa6b.tar.bz2
llvm-9cfb3adf44e14cca2b32c447b36574ef82a7aa6b.tar.xz
Add some potentially interesting transformations to README.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/README.txt')
-rw-r--r--lib/Target/README.txt51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index 69da35f1c7..080ea42dcc 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -1665,3 +1665,54 @@ int foo() {
//===---------------------------------------------------------------------===//
+Missed instcombine transformation:
+define i1 @a(i32 %x) nounwind readnone {
+entry:
+ %cmp = icmp eq i32 %x, 30
+ %sub = add i32 %x, -30
+ %cmp2 = icmp ugt i32 %sub, 9
+ %or = or i1 %cmp, %cmp2
+ ret i1 %or
+}
+This should be optimized to a single compare. Testcase derived from gcc.
+
+//===---------------------------------------------------------------------===//
+
+Missed instcombine transformation:
+void b();
+void a(int x) { if (((1<<x)&8)==0) b(); }
+
+The shift should be optimized out. Testcase derived from gcc.
+
+//===---------------------------------------------------------------------===//
+
+Missed instcombine or reassociate transformation:
+int a(int a, int b) { return (a==12)&(b>47)&(b<58); }
+
+The sgt and slt should be combined into a single comparison. Testcase derived
+from gcc.
+
+//===---------------------------------------------------------------------===//
+
+Missed instcombine transformation:
+define i32 @a(i32 %x) nounwind readnone {
+entry:
+ %shr = lshr i32 %x, 5 ; <i32> [#uses=1]
+ %xor = xor i32 %shr, 67108864 ; <i32> [#uses=1]
+ %sub = add i32 %xor, -67108864 ; <i32> [#uses=1]
+ ret i32 %sub
+}
+
+This function is equivalent to "ashr i32 %x, 5". Testcase derived from gcc.
+
+//===---------------------------------------------------------------------===//
+
+isSafeToLoadUnconditionally should allow a GEP of a global/alloca with constant
+indicies within the bounds of the allocated object. Reduced example:
+
+const int a[] = {3,6};
+int b(int y) { int* x = y ? &a[0] : &a[1]; return *x; }
+
+All the loads should be eliminated. Testcase derived from gcc.
+
+//===---------------------------------------------------------------------===//