llvm-6502/lib/Transforms
Chris Lattner 955f331a77 Fold (and (setcc X, C1), (setcc X, C2))
This is important for several reasons:

1. Benchmarks have lots of code that looks like this (perlbmk in particular):

  %tmp.2.i = setne int %tmp.0.i, 128              ; <bool> [#uses=1]
  %tmp.6343 = seteq int %tmp.0.i, 1               ; <bool> [#uses=1]
  %tmp.63 = and bool %tmp.2.i, %tmp.6343          ; <bool> [#uses=1]

   we now fold away the setne, a clear improvement.

2. In the more important cases, such as (X >= 10) & (X < 20), we now produce
   smaller code: (X-10) < 10.

3. Perhaps the nicest effect of this patch is that it really helps out the
   code generators.  In particular, for a 'range test' like the above,
   instead of generating this on X86 (the difference on PPC is even more
   pronounced):

        cmp %EAX, 50
        setge %CL
        cmp %EAX, 100
        setl %AL
        and %CL, %AL
        cmp %CL, 0

   we now generate this:

        add %EAX, -50
        cmp %EAX, 50

   Furthermore, this causes setcc's to be folded into branches more often.

These combinations trigger dozens of times in the spec benchmarks, particularly
in 176.gcc, 186.crafty, 253.perlbmk, 254.gap, & 099.go.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16559 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-28 21:48:02 +00:00
..
Hello Add a newline 2004-09-15 17:53:52 +00:00
Instrumentation 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
IPO 'Pass' should now not be derived from by clients. Instead, they should derive 2004-09-20 04:48:05 +00:00
Scalar Fold (and (setcc X, C1), (setcc X, C2)) 2004-09-28 21:48:02 +00:00
Utils Pull assignment out of for loop conditional in order for this to 2004-09-28 02:40:37 +00:00
ExprTypeConvert.cpp Add includes and use std:: for standard library calls to make code 2004-09-28 14:42:44 +00:00
LevelRaise.cpp Prototype more accurately 2004-09-20 04:43:57 +00:00
Makefile Added LLVM copyright notice to Makefiles. 2003-10-20 22:26:57 +00:00
TransformInternals.cpp Merge i*.h headers into Instructions.h as part of bug403. 2004-07-29 12:17:34 +00:00
TransformInternals.h Put all LLVM code into the llvm namespace, as per bug 109. 2003-11-11 22:41:34 +00:00