From eb8730d131be888ba93f7dfc2e5457375190107e Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 16 Aug 2006 23:59:00 +0000 Subject: [PATCH] Doh. Incorrectly inverted condition. Also add a isOnlyUse check to match tablegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29741 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelDAGToDAG.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index 176314a0808..442fa8d4cf0 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -610,7 +610,8 @@ bool X86DAGToDAGISel::TryFoldLoad(SDOperand P, SDOperand N, SDOperand &Index, SDOperand &Disp) { if (N.getOpcode() == ISD::LOAD && N.hasOneUse() && - !CanBeFoldedBy(N.Val, P.Val)) + P.Val->isOnlyUse(N.Val) && + CanBeFoldedBy(N.Val, P.Val)) return SelectAddr(N.getOperand(1), Base, Scale, Index, Disp); return false; }