summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-08 05:28:22 +0000
committerChris Lattner <sabre@nondot.org>2005-08-08 05:28:22 +0000
commit9bfa6f8784acda6fa292d83462ad75c3e005bf78 (patch)
tree1999eb3debc76fbfb80abd116af025440a137a59 /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
parent24a0a43cb0c7f4bb14bf34a2571141cec4507b53 (diff)
downloadbcm5719-llvm-9bfa6f8784acda6fa292d83462ad75c3e005bf78.tar.gz
bcm5719-llvm-9bfa6f8784acda6fa292d83462ad75c3e005bf78.zip
Implement a simple optimization for the termination condition of the loop.
The termination condition actually wants to use the post-incremented value of the loop, not a new indvar with an unusual base. On PPC, for example, this allows us to compile LoopStrengthReduce/exit_compare_live_range.ll to: _foo: li r2, 0 .LBB_foo_1: ; no_exit li r5, 0 stw r5, 0(r3) addi r2, r2, 1 cmpw cr0, r2, r4 bne .LBB_foo_1 ; no_exit blr instead of: _foo: li r2, 1 ;; IV starts at 1, not 0 .LBB_foo_1: ; no_exit li r5, 0 stw r5, 0(r3) addi r5, r2, 1 cmpw cr0, r2, r4 or r2, r5, r5 ;; Reg-reg copy, extra live range bne .LBB_foo_1 ; no_exit blr This implements LoopStrengthReduce/exit_compare_live_range.ll llvm-svn: 22699
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud