llvm-6502/lib/Transforms
Chris Lattner 7259df3ab8 implement Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll.
We used to emit this code for it:

_test:
        li r2, 1     ;; Value tying up a register for the whole loop
        li r5, 0
LBB_test_1:     ; no_exit.2
        or r6, r5, r5
        li r5, 0
        stw r5, 0(r3)
        addi r5, r6, 1
        addi r3, r3, 4
        add r7, r2, r5  ;; should be addi r7, r5, 1
        cmpwi cr0, r7, 701
        blt cr0, LBB_test_1     ; no_exit.2
LBB_test_2:     ; loopexit.2.loopexit
        addi r2, r6, 2
        stw r2, 0(r4)
        blr

now we emit this:

_test:
        li r2, 0
LBB_test_1:     ; no_exit.2
        or r5, r2, r2
        li r2, 0
        stw r2, 0(r3)
        addi r3, r3, 4
        addi r2, r5, 1
        addi r6, r5, 2   ;; whoa, fold those adds!
        cmpwi cr0, r6, 701
        blt cr0, LBB_test_1     ; no_exit.2
LBB_test_2:     ; loopexit.2.loopexit
        addi r2, r5, 2
        stw r2, 0(r4)
        blr

more improvement coming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23306 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-10 01:18:45 +00:00
..
Hello Remove trailing whitespace 2005-04-21 23:48:37 +00:00
Instrumentation Eliminate tabs and trailing spaces 2005-04-23 21:38:35 +00:00
IPO Transform floor((double)FLT) -> (double)floorf(FLT), implementing 2005-08-24 17:22:17 +00:00
Scalar implement Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll. 2005-09-10 01:18:45 +00:00
Utils Teach SplitCriticalEdge to update LoopInfo if it is alive. This fixes 2005-08-13 01:38:43 +00:00
ExprTypeConvert.cpp ConvertibleToGEP always returns 0, remove some old crufty code which 2005-07-26 16:38:28 +00:00
LevelRaise.cpp ConvertibleToGEP always returns 0, remove some old crufty code which 2005-07-26 16:38:28 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
TransformInternals.cpp ConvertibleToGEP always returns 0, remove some old crufty code which 2005-07-26 16:38:28 +00:00
TransformInternals.h ConvertibleToGEP always returns 0, remove some old crufty code which 2005-07-26 16:38:28 +00:00