Fix checking of intermediates having one use in isADDADDMUL

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98164 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Richard Osborne 2010-03-10 17:16:29 +00:00
parent 886d861355
commit ea670df852

View File

@ -607,10 +607,11 @@ isADDADDMUL(SDValue Op, SDValue &Mul0, SDValue &Mul1, SDValue &Addend0,
} else {
return false;
}
if (requireIntermediatesHaveOneUse && !AddOp.hasOneUse())
return false;
if (OtherOp.getOpcode() == ISD::MUL) {
// add(add(a,b),mul(x,y))
if (requireIntermediatesHaveOneUse &&
(!OtherOp.hasOneUse() || !AddOp.hasOneUse()))
if (requireIntermediatesHaveOneUse && !OtherOp.hasOneUse())
return false;
Mul0 = OtherOp.getOperand(0);
Mul1 = OtherOp.getOperand(1);