X86: Fix optimizeCompare to correctly check safe condition.
authorManman Ren <mren@apple.com>
Sat, 7 Jul 2012 03:34:46 +0000 (03:34 +0000)
committerManman Ren <mren@apple.com>
Sat, 7 Jul 2012 03:34:46 +0000 (03:34 +0000)
commit2d4215f75949448d5207ec67b11878741a708fbe
treea41f6d1f7fa6643e1aee92b9aace18b4fc24d03d
parent845b4c2f0b2b3f0ec468ac863550b25708279180
X86: Fix optimizeCompare to correctly check safe condition.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159888 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/jump_sign.ll