[llvm] r258073 - [RDF] Allow unlinking ref nodes from data-flow chains only
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 18 12:41:34 PST 2016
Author: kparzysz
Date: Mon Jan 18 14:41:34 2016
New Revision: 258073
URL: http://llvm.org/viewvc/llvm-project?rev=258073&view=rev
Log:
[RDF] Allow unlinking ref nodes from data-flow chains only
Modified:
llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp
llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp
llvm/trunk/lib/Target/Hexagon/RDFGraph.h
Modified: llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp?rev=258073&r1=258072&r2=258073&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/RDFDeadCode.cpp Mon Jan 18 14:41:34 2016
@@ -183,9 +183,9 @@ bool DeadCodeElimination::erase(const Se
if (trace())
dbgs() << " " << PrintNode<RefNode*>(RA, DFG) << '\n';
if (DFG.IsUse(RA))
- DFG.unlinkUse(RA);
+ DFG.unlinkUse(RA, true);
else if (DFG.IsDef(RA))
- DFG.unlinkDef(RA);
+ DFG.unlinkDef(RA, true);
}
// Now, remove all dead instruction nodes.
Modified: llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp?rev=258073&r1=258072&r2=258073&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/RDFGraph.cpp Mon Jan 18 14:41:34 2016
@@ -1456,9 +1456,9 @@ void DataFlowGraph::removeUnusedPhis() {
PhiQ.insert(OA.Id);
}
if (RA.Addr->isDef())
- unlinkDef(RA);
+ unlinkDef(RA, true);
else
- unlinkUse(RA);
+ unlinkUse(RA, true);
}
NodeAddr<BlockNode*> BA = PA.Addr->getOwner(*this);
BA.Addr->removeMember(PA, *this);
@@ -1593,13 +1593,10 @@ void DataFlowGraph::linkBlockRefs(DefSta
}
// Remove the use node UA from any data-flow and structural links.
-void DataFlowGraph::unlinkUse(NodeAddr<UseNode*> UA) {
+void DataFlowGraph::unlinkUseDF(NodeAddr<UseNode*> UA) {
NodeId RD = UA.Addr->getReachingDef();
NodeId Sib = UA.Addr->getSibling();
- NodeAddr<InstrNode*> IA = UA.Addr->getOwner(*this);
- IA.Addr->removeMember(UA, *this);
-
if (RD == 0) {
assert(Sib == 0);
return;
@@ -1623,7 +1620,7 @@ void DataFlowGraph::unlinkUse(NodeAddr<U
}
// Remove the def node DA from any data-flow and structural links.
-void DataFlowGraph::unlinkDef(NodeAddr<DefNode*> DA) {
+void DataFlowGraph::unlinkDefDF(NodeAddr<DefNode*> DA) {
//
// RD
// | reached
@@ -1710,7 +1707,4 @@ void DataFlowGraph::unlinkDef(NodeAddr<D
Last.Addr->setSibling(RDA.Addr->getReachedUse());
RDA.Addr->setReachedUse(ReachedUses.front().Id);
}
-
- NodeAddr<InstrNode*> IA = DA.Addr->getOwner(*this);
- IA.Addr->removeMember(DA, *this);
}
Modified: llvm/trunk/lib/Target/Hexagon/RDFGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/RDFGraph.h?rev=258073&r1=258072&r2=258073&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/RDFGraph.h (original)
+++ llvm/trunk/lib/Target/Hexagon/RDFGraph.h Mon Jan 18 14:41:34 2016
@@ -697,8 +697,16 @@ namespace rdf {
NodeList getRelatedRefs(NodeAddr<InstrNode*> IA,
NodeAddr<RefNode*> RA) const;
- void unlinkUse(NodeAddr<UseNode*> UA);
- void unlinkDef(NodeAddr<DefNode*> DA);
+ void unlinkUse(NodeAddr<UseNode*> UA, bool RemoveFromOwner) {
+ unlinkUseDF(UA);
+ if (RemoveFromOwner)
+ removeFromOwner(UA);
+ }
+ void unlinkDef(NodeAddr<DefNode*> DA, bool RemoveFromOwner) {
+ unlinkDefDF(DA);
+ if (RemoveFromOwner)
+ removeFromOwner(DA);
+ }
// Some useful filters.
template <uint16_t Kind>
@@ -765,6 +773,13 @@ namespace rdf {
void linkStmtRefs(DefStackMap &DefM, NodeAddr<StmtNode*> SA);
void linkBlockRefs(DefStackMap &DefM, NodeAddr<BlockNode*> BA);
+ void unlinkUseDF(NodeAddr<UseNode*> UA);
+ void unlinkDefDF(NodeAddr<DefNode*> DA);
+ void removeFromOwner(NodeAddr<RefNode*> RA) {
+ NodeAddr<InstrNode*> IA = RA.Addr->getOwner(*this);
+ IA.Addr->removeMember(RA, *this);
+ }
+
TimerGroup TimeG;
NodeAddr<FuncNode*> Func;
NodeAllocator Memory;
More information about the llvm-commits
mailing list