llvm-6502/lib
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
..
Analysis floor/ceil don't read/write memory. This allows gcse to eliminate 6 calls 2005-08-24 16:58:56 +00:00
Archive Final Changes For PR495: 2005-07-08 03:08:58 +00:00
AsmParser Implement PR614: 2005-08-27 18:50:39 +00:00
Bytecode Culling out use of unions for converting FP to bits and vice versa. 2005-08-17 19:34:49 +00:00
CodeGen Allow targets to say they don't support truncstore i1 (which includes a mask 2005-09-10 00:20:18 +00:00
Debugger For PR495: 2005-07-07 23:21:43 +00:00
ExecutionEngine Add help support for -mcpu and -mattr. 2005-09-02 19:27:43 +00:00
Linker For PR495: 2005-07-07 23:21:43 +00:00
Support Allow bugpoint+PPC codegen to use fsqrt 2005-08-29 13:14:24 +00:00
System For PR616: 2005-08-24 10:07:20 +00:00
Target PowerPC cannot truncstore i1 natively 2005-09-10 00:21:06 +00:00
Transforms implement Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll. 2005-09-10 01:18:45 +00:00
VMCore add printer support for flag operands 2005-08-25 17:59:23 +00:00
Makefile