Fixed bug when custom lowering DEC64m on x86.

If the DEC node had more than one user, it was doing this lowering but
leaving the original DEC node around and so decrementing twice.

Fixes PR11964.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150356 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Pete Cooper
2012-02-13 00:10:03 +00:00
parent 2ee746b87d
commit ce3900849a
2 changed files with 25 additions and 0 deletions

View File

@@ -2378,6 +2378,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
Chain->getOpcode() != ISD::LOAD ||
StoredVal->getOpcode() != X86ISD::DEC ||
StoredVal.getResNo() != 0 ||
!StoredVal.getNode()->hasNUsesOfValue(1, 0) ||
StoredVal->getOperand(0).getNode() != Chain.getNode())
break;