forked from OSchip/llvm-project
Fix a bug in SelectScalarSSELoad. Since the load is wrapped in a
SCALAR_TO_VECTOR, even if the hasOneUse() check pass we may end up folding the load into two instructions. Make sure we check the SCALAR_TO_VECTOR has only one use as well. llvm-svn: 31641
This commit is contained in:
parent
bc60d34748
commit
fb44822a98
|
@ -815,6 +815,7 @@ bool X86DAGToDAGISel::SelectScalarSSELoad(SDOperand Op, SDOperand Pred,
|
|||
InChain = N.getOperand(0).getValue(1);
|
||||
if (ISD::isNON_EXTLoad(InChain.Val) &&
|
||||
InChain.getValue(0).hasOneUse() &&
|
||||
N.hasOneUse() &&
|
||||
CanBeFoldedBy(N.Val, Pred.Val, Op.Val)) {
|
||||
LoadSDNode *LD = cast<LoadSDNode>(InChain);
|
||||
if (!SelectAddr(Op, LD->getBasePtr(), Base, Scale, Index, Disp))
|
||||
|
|
Loading…
Reference in New Issue