ARM: Fix optimizeCompare to correctly check safe condition.
authorManman Ren <mren@apple.com>
Wed, 11 Jul 2012 22:51:44 +0000 (22:51 +0000)
committerManman Ren <mren@apple.com>
Wed, 11 Jul 2012 22:51:44 +0000 (22:51 +0000)
commit45ed19499b8f7025d9acf91cc37fbf6ea63abc4f
treea62c7eab67e6865b2e5c3f3b2e898f419a352fab
parent1d82115042c81793cc3d807a8136f7f0f475f083
ARM: Fix optimizeCompare to correctly check safe condition.

It is safe if CPSR is killed or re-defined.
When we are done with the basic block, check whether CPSR is live-out.
Do not optimize away cmp if CPSR is live-out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160090 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMBaseInstrInfo.cpp
test/CodeGen/ARM/sub-cmp-peephole.ll