From: Krzysztof Parzyszek Date: Mon, 23 Jan 2017 23:03:49 +0000 (+0000) Subject: [RDF] Add registers to live set even if they are live already X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8614146660ce92a86cbbb860d88f368b81128365;p=llvm [RDF] Add registers to live set even if they are live already When calculating kills, a register may be considered live because a part of it is live, but if there is a use of that (whole) register, the whole register (and its subregisters) need to be added to the live set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292845 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/RDFLiveness.cpp b/lib/Target/Hexagon/RDFLiveness.cpp index e74c4bfc164..f0f93285254 100644 --- a/lib/Target/Hexagon/RDFLiveness.cpp +++ b/lib/Target/Hexagon/RDFLiveness.cpp @@ -377,9 +377,9 @@ void Liveness::computePhiInfo() { NodeAddr A = DFG.addr(UN); uint16_t F = A.Addr->getFlags(); if ((F & (NodeAttrs::Undef | NodeAttrs::PhiRef)) == 0) { - RegisterRef R = DFG.normalizeRef(getRestrictedRegRef(A)); + RegisterRef R = DFG.normalizeRef(getRestrictedRegRef(A)); RealUses[R.Reg].insert({A.Id,R.Mask}); - } + } UN = A.Addr->getSibling(); } // Visit all reached defs, and add them to the queue. These defs may @@ -424,7 +424,7 @@ void Liveness::computePhiInfo() { auto UA = DFG.addr(I->first); // Undef flag is checked above. assert((UA.Addr->getFlags() & NodeAttrs::Undef) == 0); - RegisterRef R(UI->first, I->second); + RegisterRef R(UI->first, I->second); NodeList RDs = getAllReachingDefs(R, UA); if (any_of(RDs, InPhiDefs)) ++I; @@ -803,9 +803,8 @@ void Liveness::resetKills(MachineBasicBlock *B) { IsLive = true; break; } - if (IsLive) - continue; - Op.setIsKill(true); + if (!IsLive) + Op.setIsKill(true); for (MCSubRegIterator SR(R, &TRI, true); SR.isValid(); ++SR) Live.set(*SR); }