Reapply 155668: Fix the SD scheduler to avoid gluing the same node twice.
authorAndrew Trick <atrick@apple.com>
Sat, 28 Apr 2012 01:03:23 +0000 (01:03 +0000)
committerAndrew Trick <atrick@apple.com>
Sat, 28 Apr 2012 01:03:23 +0000 (01:03 +0000)
commit2674a4acdb51ce610d060b76608f631765a6e508
treeb5f5bf7379f9188e02c54292513db52b2c2aded1
parenta9cc08f24f61e2663a131d7ac16c329b75162e7b
Reapply 155668: Fix the SD scheduler to avoid gluing the same node twice.

This time, also fix the caller of AddGlue to properly handle
incomplete chains. AddGlue had failure modes, but shamefully hid them
from its caller. It's luck ran out.

Fixes rdar://11314175: BuildSchedUnits assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155749 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
test/CodeGen/X86/2012-04-26-sdglue.ll [new file with mode: 0644]