summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-04-22 18:47:44 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-04-22 18:47:44 +0000
commit341c11da3bda1a3f877a3dc6e96f7d1f866f703f (patch)
tree228b68cdcf3a22072f811465d3ab9fbcf8ab2523 /llvm/lib/Target
parentad45d911bb63141f0904b00c41a5f4f992f0ef33 (diff)
downloadbcm5719-llvm-341c11da3bda1a3f877a3dc6e96f7d1f866f703f.tar.gz
bcm5719-llvm-341c11da3bda1a3f877a3dc6e96f7d1f866f703f.zip
DAGCombine: fold "(zext x) == C" into "x == (trunc C)" if the trunc is lossless.
On x86 this allows to fold a load into the cmp, greatly reducing register pressure. movzbl (%rdi), %eax cmpl $47, %eax -> cmpb $47, (%rdi) This shaves 8k off gcc.o on i386. I'll leave applying the patch in README.txt to Chris :) llvm-svn: 130005
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/README.txt31
1 files changed, 1 insertions, 30 deletions
diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt
index 5032b2bbbb5..c345ce50c0e 100644
--- a/llvm/lib/Target/README.txt
+++ b/llvm/lib/Target/README.txt
@@ -2259,34 +2259,6 @@ icmp transform.
//===---------------------------------------------------------------------===//
-These functions:
-int foo(int *X) {
- if ((*X & 255) == 47)
- bar();
-}
-int foo2(int X) {
- if ((X & 255) == 47)
- bar();
-}
-
-codegen to:
-
- movzbl (%rdi), %eax
- cmpl $47, %eax
- jne LBB0_2
-
-and:
- movzbl %dil, %eax
- cmpl $47, %eax
- jne LBB1_2
-
-If a dag combine shrunk the compare to a byte compare, then we'd fold the load
-in the first example, and eliminate the movzbl in the second, saving a register.
-This can be a target independent dag combine that works on ISD::SETCC, it would
-catch this before the legalize ops pass.
-
-//===---------------------------------------------------------------------===//
-
We should optimize this:
%tmp = load i16* %arrayidx, align 4, !tbaa !0
@@ -2329,8 +2301,7 @@ Index: InstCombine/InstCombineCompares.cpp
{
-but we can't do that until the dag combine above is added. Not having this
-is blocking resolving PR6627.
+Not having this is blocking resolving PR6627.
//===---------------------------------------------------------------------===//
OpenPOWER on IntegriCloud