Changes in directory llvm/lib/Target/X86:
X86ISelDAGToDAG.cpp updated: 1.119 -> 1.120 --- Log message: SelectScalarSSELoad should call CanBeFoldedBy as well. --- Diffs of the changes: (+7 -3) X86ISelDAGToDAG.cpp | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.119 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.120 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.119 Sat Oct 14 03:33:25 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Oct 16 01:34:55 2006 @@ -147,7 +147,8 @@ SDOperand &Index, SDOperand &Disp); bool SelectLEAAddr(SDOperand N, SDOperand &Base, SDOperand &Scale, SDOperand &Index, SDOperand &Disp); - bool SelectScalarSSELoad(SDOperand N, SDOperand &Base, SDOperand &Scale, + bool SelectScalarSSELoad(SDOperand Root, SDOperand Pred, + SDOperand N, SDOperand &Base, SDOperand &Scale, SDOperand &Index, SDOperand &Disp, SDOperand &InChain, SDOperand &OutChain); bool TryFoldLoad(SDOperand P, SDOperand N, @@ -804,13 +805,16 @@ /// SelectScalarSSELoad - Match a scalar SSE load. In particular, we want to /// match a load whose top elements are either undef or zeros. The load flavor /// is derived from the type of N, which is either v4f32 or v2f64. -bool X86DAGToDAGISel::SelectScalarSSELoad(SDOperand N, SDOperand &Base, +bool X86DAGToDAGISel::SelectScalarSSELoad(SDOperand Root, SDOperand Pred, + SDOperand N, SDOperand &Base, SDOperand &Scale, SDOperand &Index, SDOperand &Disp, SDOperand &InChain, SDOperand &OutChain) { if (N.getOpcode() == ISD::SCALAR_TO_VECTOR) { InChain = N.getOperand(0).getValue(1); - if (ISD::isNON_EXTLoad(InChain.Val) && InChain.getValue(0).hasOneUse()) { + if (ISD::isNON_EXTLoad(InChain.Val) && + InChain.getValue(0).hasOneUse() && + CanBeFoldedBy(N.Val, Pred.Val, Root.Val)) { LoadSDNode *LD = cast<LoadSDNode>(InChain); if (!SelectAddr(LD->getBasePtr(), Base, Scale, Index, Disp)) return false; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits