OSDN Git Service

When we look at instructions to convert to setting the 's' flag, we need to look
authorBill Wendling <isanbard@gmail.com>
Mon, 1 Nov 2010 20:41:43 +0000 (20:41 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 1 Nov 2010 20:41:43 +0000 (20:41 +0000)
commit53b2e23459e1c21c51bf220e7a548baf69217dfd
tree0a7532ce26ca88bdf916ac31523fb44d574efe94
parent23a698e5c756c5cac7b0a7f640391443b3809dcb
When we look at instructions to convert to setting the 's' flag, we need to look
at more than those which define CPSR. You can have this situation:

(1)  subs  ...
(2)  sub   r6, r5, r4
(3)  movge ...
(4)  cmp   r6, 0
(5)  movge ...

We cannot convert (2) to "subs" because (3) is using the CPSR set by
(1). There's an analogous situation here:

(1)  sub   r1, r2, r3
(2)  sub   r4, r5, r6
(3)  cmp   r4, ...
(5)  movge ...
(6)  cmp   r1, ...
(7)  movge ...

We cannot convert (1) to "subs" because of the intervening use of CPSR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117950 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/PeepholeOptimizer.cpp
lib/Target/ARM/ARMBaseInstrInfo.cpp
test/CodeGen/ARM/arm-and-tst-peephole.ll
test/CodeGen/ARM/long_shift.ll