Fix PR6497, a bug where we'd fold a load into an addc
authorChris Lattner <sabre@nondot.org>
Fri, 5 Mar 2010 06:19:13 +0000 (06:19 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 5 Mar 2010 06:19:13 +0000 (06:19 +0000)
commit18fdabadca110671b436de52fe7bd492ad49e656
tree96e009235a8cfdc293c8bc3b340619d855272052
parent1beaf41ef6fd29e96cff75fb173133f09822745f
Fix PR6497, a bug where we'd fold a load into an addc
node which has a flag.  That flag in turn was used by an
already-selected adde which turned into an ADC32ri8 which
used a selected load which was chained to the load we
folded.  This flag use caused us to form a cycle.  Fix
this by not ignoring chains in IsLegalToFold even in
cases where the isel thinks it can.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97791 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
test/CodeGen/X86/crash.ll [new file with mode: 0644]