X86InstrInfo::copyPhysReg: workaround reg liveness
authorJF Bastien <jfb@google.com>
Fri, 4 Dec 2015 01:18:17 +0000 (01:18 +0000)
committerJF Bastien <jfb@google.com>
Fri, 4 Dec 2015 01:18:17 +0000 (01:18 +0000)
commit2012083871b75ca032fefaec739ce1f280a8f3de
treeef68d9693b97d6554b0d5e33aba4a5b952cc7267
parent2cb46213b7277fc92db5d443c8e217140e5ac2c8
X86InstrInfo::copyPhysReg: workaround reg liveness

Summary:
computeRegisterLiveness and analyzePhysReg are currently getting
confused about liveness in some cases, breaking copyPhysReg's
calculation of whether AX is dead in some cases. Work around this issue
temporarily by assuming that AX is always live.

See detail in: https://llvm.org/bugs/show_bug.cgi?id=25033#c7
And associated bugs PR24535 PR25033 PR24991 PR24992 PR25201.

This workaround makes the code correct but slightly inefficient, but it
seems to confuse the machine instr verifier which now things EAX was
undefined in some cases where it's being conservatively saved /
restored.

Reviewers: majnemer, sanjoy
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D15198

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254680 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/cmpxchg-clobber-flags.ll
test/CodeGen/X86/peephole-na-phys-copy-folding.ll