Fix the bootstrap failure caused by r299986.
authorEaswaran Raman <eraman@google.com>
Wed, 12 Apr 2017 15:26:15 +0000 (15:26 +0000)
committerEaswaran Raman <eraman@google.com>
Wed, 12 Apr 2017 15:26:15 +0000 (15:26 +0000)
llvm-svn: 300069

llvm/lib/Target/X86/X86InstrInfo.cpp

index ddc7ea4c33cd6f0634d42c3a294fd1326411acb5..722fb12fadd53a042893ff38f65b438d1786f445 100644 (file)
@@ -8990,6 +8990,10 @@ X86InstrInfo::areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2,
       !HasSameOp(X86::AddrIndexReg) || !HasSameOp(X86::AddrSegmentReg))
     return false;
 
+  // Chain Operand must be the same.
+  if (!HasSameOp(5))
+    return false;
+
   // Now let's examine if the displacements are constants.
   auto Disp1 = dyn_cast<ConstantSDNode>(Load1->getOperand(X86::AddrDisp));
   auto Disp2 = dyn_cast<ConstantSDNode>(Load2->getOperand(X86::AddrDisp));