ScheduleDAG: record PhysReg dependencies represented by CopyFromReg nodes
authorTim Northover <tnorthover@apple.com>
Thu, 23 Oct 2014 22:31:48 +0000 (22:31 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 23 Oct 2014 22:31:48 +0000 (22:31 +0000)
commitc0ecebb32b4c97319b5974f60be56c4a5f186684
tree968a9e6c5ea45c3ab660bd737683c6b9f5a52a56
parent991327143f237597c8df01b8b08642c719da8a58
ScheduleDAG: record PhysReg dependencies represented by CopyFromReg nodes

x86's CMPXCHG -> EFLAGS consumer wasn't being recorded as a real EFLAGS
dependency because it was represented by a pair of CopyFromReg(EFLAGS) ->
CopyToReg(EFLAGS) nodes. ScheduleDAG was expecting the source to be an
implicit-def on the instruction, where the result numbers in the DAG and the
Uses list in TableGen matched up precisely.

The Copy notation seems much more robust, so this patch extends ScheduleDAG
rather than refactoring x86.

Should fix PR20376.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220529 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
test/CodeGen/X86/cmpxchg-clobber-flags.ll [new file with mode: 0644]