From 586fc12e320d243b0efde5b0a058ffd9b0ef9c3f Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Tue, 27 Sep 2016 18:24:33 +0000 Subject: [RDF] Add "dead" flag to node attributes llvm-svn: 282520 --- llvm/lib/Target/Hexagon/RDFGraph.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target/Hexagon/RDFGraph.cpp') diff --git a/llvm/lib/Target/Hexagon/RDFGraph.cpp b/llvm/lib/Target/Hexagon/RDFGraph.cpp index 72a55f2b9de..c180f99f219 100644 --- a/llvm/lib/Target/Hexagon/RDFGraph.cpp +++ b/llvm/lib/Target/Hexagon/RDFGraph.cpp @@ -65,6 +65,8 @@ raw_ostream &operator<< (raw_ostream &OS, const Print &P) { case NodeAttrs::Ref: if (Flags & NodeAttrs::Undef) OS << '/'; + if (Flags & NodeAttrs::Dead) + OS << '\\'; if (Flags & NodeAttrs::Preserving) OS << '+'; if (Flags & NodeAttrs::Clobbering) @@ -1316,7 +1318,8 @@ void DataFlowGraph::buildStmt(NodeAddr BA, MachineInstr &In) { while (uint16_t R = *ImpU++) ImpUses.insert({R, 0}); - bool NeedsImplicit = isCall(In) || In.isInlineAsm() || In.isReturn(); + bool IsCall = isCall(In); + bool NeedsImplicit = IsCall || In.isInlineAsm() || In.isReturn(); bool IsPredicated = TII.isPredicated(In); unsigned NumOps = In.getNumOperands(); @@ -1342,6 +1345,8 @@ void DataFlowGraph::buildStmt(NodeAddr BA, MachineInstr &In) { Flags |= NodeAttrs::Clobbering; if (TOI.isFixedReg(In, OpN)) Flags |= NodeAttrs::Fixed; + if (IsCall && Op.isDead()) + Flags |= NodeAttrs::Dead; NodeAddr DA = newDef(SA, Op, Flags); SA.Addr->addMember(DA, *this); DoneDefs.insert(RR); @@ -1369,6 +1374,8 @@ void DataFlowGraph::buildStmt(NodeAddr BA, MachineInstr &In) { Flags |= NodeAttrs::Clobbering; if (TOI.isFixedReg(In, OpN)) Flags |= NodeAttrs::Fixed; + if (IsCall && Op.isDead()) + Flags |= NodeAttrs::Dead; NodeAddr DA = newDef(SA, Op, Flags); SA.Addr->addMember(DA, *this); DoneDefs.insert(RR); -- cgit v1.2.3