diff options
| author | Justin Bogner <mail@justinbogner.com> | 2016-05-12 20:54:27 +0000 |
|---|---|---|
| committer | Justin Bogner <mail@justinbogner.com> | 2016-05-12 20:54:27 +0000 |
| commit | 3525da74661cfbbf78b69b7b5628d7b6603d7927 (patch) | |
| tree | 7ea8e36799aab255c425cdb24d5b2d82b861e0f3 /llvm/lib | |
| parent | 740af6f3b049980e428a64e3f909cba354684ac5 (diff) | |
| download | bcm5719-llvm-3525da74661cfbbf78b69b7b5628d7b6603d7927.tar.gz bcm5719-llvm-3525da74661cfbbf78b69b7b5628d7b6603d7927.zip | |
SDAG: Clean up dangling nodes in AArch64ISelDAGToDAG::SelectImpl
When we convert to the void Select interface, leaving unreferenced
nodes around won't be allowed anymore.
Part of llvm.org/pr26808.
llvm-svn: 269345
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp index c833a92de67..4a4b95be69c 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp @@ -1125,7 +1125,7 @@ SDNode *AArch64DAGToDAGISel::SelectIndexedLoad(SDNode *N, bool &Done) { ReplaceUses(SDValue(N, 0), LoadedVal); ReplaceUses(SDValue(N, 1), SDValue(Res, 0)); ReplaceUses(SDValue(N, 2), SDValue(Res, 2)); - + CurDAG->RemoveDeadNode(N); return nullptr; } @@ -1147,6 +1147,7 @@ SDNode *AArch64DAGToDAGISel::SelectLoad(SDNode *N, unsigned NumVecs, CurDAG->getTargetExtractSubreg(SubRegIdx + i, dl, VT, SuperReg)); ReplaceUses(SDValue(N, NumVecs), SDValue(Ld, 1)); + CurDAG->RemoveDeadNode(N); return nullptr; } @@ -1179,6 +1180,7 @@ SDNode *AArch64DAGToDAGISel::SelectPostLoad(SDNode *N, unsigned NumVecs, // Update the chain ReplaceUses(SDValue(N, NumVecs + 1), SDValue(Ld, 2)); + CurDAG->RemoveDeadNode(N); return nullptr; } @@ -1290,8 +1292,8 @@ SDNode *AArch64DAGToDAGISel::SelectLoadLane(SDNode *N, unsigned NumVecs, } ReplaceUses(SDValue(N, NumVecs), SDValue(Ld, 1)); - - return Ld; + CurDAG->RemoveDeadNode(N); + return nullptr; } SDNode *AArch64DAGToDAGISel::SelectPostLoadLane(SDNode *N, unsigned NumVecs, @@ -1346,8 +1348,8 @@ SDNode *AArch64DAGToDAGISel::SelectPostLoadLane(SDNode *N, unsigned NumVecs, // Update the Chain ReplaceUses(SDValue(N, NumVecs + 1), SDValue(Ld, 2)); - - return Ld; + CurDAG->RemoveDeadNode(N); + return nullptr; } SDNode *AArch64DAGToDAGISel::SelectStoreLane(SDNode *N, unsigned NumVecs, @@ -2328,6 +2330,7 @@ void AArch64DAGToDAGISel::SelectCMP_SWAP(SDNode *N) { ReplaceUses(SDValue(N, 0), SDValue(CmpSwap, 0)); ReplaceUses(SDValue(N, 1), SDValue(CmpSwap, 2)); + CurDAG->RemoveDeadNode(N); } SDNode *AArch64DAGToDAGISel::SelectImpl(SDNode *Node) { |

