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
This commit is contained in:
Evan Cheng 2006-08-16 23:59:00 +00:00
parent be384162c6
commit eb8730d131

View File

@ -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;
}