summaryrefslogtreecommitdiff
path: root/lib/Target/README.txt
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-11-15 17:51:23 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-11-15 17:51:23 +0000
commit93f9f7a44084543f637f15a2b38791cb3e5645f2 (patch)
treec86d2e00d34cfeefd9f4bc99855c4fd72f6a981d /lib/Target/README.txt
parente0fb75d5864c0eef0464b216ac46bc1642469508 (diff)
downloadllvm-93f9f7a44084543f637f15a2b38791cb3e5645f2.tar.gz
llvm-93f9f7a44084543f637f15a2b38791cb3e5645f2.tar.bz2
llvm-93f9f7a44084543f637f15a2b38791cb3e5645f2.tar.xz
Add a complex missed optimization opportunity I came across while investigating
bug 5438. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/README.txt')
-rw-r--r--lib/Target/README.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt
index bcc55b41e1..aad621f440 100644
--- a/lib/Target/README.txt
+++ b/lib/Target/README.txt
@@ -1719,3 +1719,18 @@ static int foo(const char *X) { return strlen(X); }
int bar() { return foo("abcd"); }
//===---------------------------------------------------------------------===//
+
+InstCombine should use SimplifyDemandedBits to remove the or instruction:
+
+define i1 @test(i8 %x, i8 %y) {
+ %A = or i8 %x, 1
+ %B = icmp ugt i8 %A, 3
+ ret i1 %B
+}
+
+Currently instcombine calls SimplifyDemandedBits with either all bits or just
+the sign bit, if the comparison is obviously a sign test. In this case, we only
+need all but the bottom two bits from %A, and if we gave that mask to SDB it
+would delete the or instruction for us.
+
+//===---------------------------------------------------------------------===//