Return's chain should be matching either the chain produced by the
authorEvan Cheng <evan.cheng@apple.com>
Wed, 1 Feb 2006 01:19:32 +0000 (01:19 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 1 Feb 2006 01:19:32 +0000 (01:19 +0000)
value or the chain going into the load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25863 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index dce781d3a8b636613fdd815be61604f95037ba7f..d692780179cad0b781059e2f28bf4695396e933b 100644 (file)
@@ -1916,7 +1916,8 @@ SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
         SDOperand Chain = Op.getOperand(0);
         SDOperand Value = Op.getOperand(1);
 
-        if (Value.getOpcode() == ISD::LOAD && Chain == Value.getOperand(0)) {
+        if (Value.getOpcode() == ISD::LOAD &&
+            (Chain == Value.getValue(1) || Chain == Value.getOperand(0))) {
           Chain  = Value.getOperand(0);
           MemLoc = Value.getOperand(1);
         } else {