llvm-6502/lib/Transforms
Chris Lattner 59fdaeeae8 Change the canonical induction variable that we insert.
Instead of producing code like this:

Loop:
  X = phi 0, X2
  ...

  X2 = X + 1
  if (X != N-1) goto Loop

We now generate code that looks like this:

Loop:
  X = phi 0, X2
  ...

  X2 = X + 1
  if (X2 != N) goto Loop

This has two big advantages:
  1. The trip count of the loop is now explicit in the code, allowing
     the direct implementation of Loop::getTripCount()
  2. This reduces register pressure in the loop, and allows X and X2 to be
     put into the same register.

As a consequence of the second point, the code we generate for loops went
from:

.LBB2:  # no_exit.1
	...
        mov %EDI, %ESI
        inc %EDI
        cmp %ESI, 2
        mov %ESI, %EDI
        jne .LBB2 # PC rel: no_exit.1

To:

.LBB2:  # no_exit.1
	...
        inc %ESI
        cmp %ESI, 3
        jne .LBB2 # PC rel: no_exit.1

... which has two fewer moves, and uses one less register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12961 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-15 15:21:43 +00:00
..
Hello Finegrainify namespacification 2004-01-09 06:12:26 +00:00
Instrumentation Support getelementptr instructions which use uint's to index into structure 2004-04-05 01:30:19 +00:00
IPO Actually update the call graph as the inliner changes it. This allows us to 2004-04-12 05:37:29 +00:00
Scalar Change the canonical induction variable that we insert. 2004-04-15 15:21:43 +00:00
Utils Add a simple call constant propagation interface. 2004-04-13 19:28:52 +00:00
ExprTypeConvert.cpp Support getelementptr instructions which use uint's to index into structure 2004-04-05 01:30:19 +00:00
LevelRaise.cpp Support getelementptr instructions which use uint's to index into structure 2004-04-05 01:30:19 +00:00
Makefile Added LLVM copyright notice to Makefiles. 2003-10-20 22:26:57 +00:00
TransformInternals.cpp Support getelementptr instructions which use uint's to index into structure 2004-04-05 01:30:19 +00:00
TransformInternals.h Put all LLVM code into the llvm namespace, as per bug 109. 2003-11-11 22:41:34 +00:00