ISelDAG: spot chain cycles involving MachineNodes
authorTim Northover <tnorthover@apple.com>
Sun, 22 Sep 2013 08:21:56 +0000 (08:21 +0000)
committerTim Northover <tnorthover@apple.com>
Sun, 22 Sep 2013 08:21:56 +0000 (08:21 +0000)
commit3e84ad28d4d3ceee25771b1e30315c20b7608c39
tree8c7736799f6055bce7c663d2865140c69015356e
parent7d052f272d3f9ad0acdebf6811e29d529f70c1e1
ISelDAG: spot chain cycles involving MachineNodes

Previously, the DAGISel function WalkChainUsers was spotting that it
had entered already-selected territory by whether a node was a
MachineNode (amongst other things). Since it's fairly common practice
to insert MachineNodes during ISelLowering, this was not the correct
check.

Looking around, it seems that other nodes get their NodeId set to -1
upon selection, so this makes sure the same thing happens to all
MachineNodes and uses that characteristic to determine whether we
should stop looking for a loop during selection.

This should fix PR15840.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191165 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
lib/Target/ARM/ARMISelDAGToDAG.cpp
lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
lib/Target/MSP430/MSP430ISelDAGToDAG.cpp
lib/Target/Mips/MipsISelDAGToDAG.cpp
lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/R600/AMDGPUISelDAGToDAG.cpp
lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp
test/CodeGen/X86/2012-01-16-mfence-nosse-flags.ll
test/CodeGen/X86/i486-fence-loop.ll [new file with mode: 0644]