From 0d084c9e4aabb33df7f566de91a16df77c657c9a Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 1 Feb 2006 00:20:21 +0000 Subject: [PATCH] When folding a load into a return of SSE value, check the chain to ensure the memory location has not been clobbered. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25861 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 1a60368bbb2..dce781d3a8b 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -1912,10 +1912,11 @@ SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { Ops.push_back(Op.getOperand(1)); Copy = DAG.getNode(X86ISD::FP_SET_RESULT, Tys, Ops); } else { - SDOperand MemLoc, Chain; + SDOperand MemLoc; + SDOperand Chain = Op.getOperand(0); SDOperand Value = Op.getOperand(1); - if (Value.getOpcode() == ISD::LOAD) { + if (Value.getOpcode() == ISD::LOAD && Chain == Value.getOperand(0)) { Chain = Value.getOperand(0); MemLoc = Value.getOperand(1); } else {