Home | History | Annotate | Download | only in CodeGen

Lines Matching refs:dv

176   DomainValue *retain(DomainValue *DV) {
177 if (DV) ++DV->Refs;
178 return DV;
184 void setLiveReg(int rx, DomainValue *DV);
187 void collapse(DomainValue *dv, unsigned domain);
211 DomainValue *dv = Avail.empty() ?
215 dv->addDomain(domain);
216 assert(dv->Refs == 0 && "Reference count wasn't cleared");
217 assert(!dv->Next && "Chained DomainValue shouldn't have been recycled");
218 return dv;
221 /// release - Release a reference to DV. When the last reference is released,
223 void ExeDepsFix::release(DomainValue *DV) {
224 while (DV) {
225 assert(DV->Refs && "Bad DomainValue");
226 if (--DV->Refs)
229 // There are no more DV references. Collapse any contained instructions.
230 if (DV->AvailableDomains && !DV->isCollapsed())
231 collapse(DV, DV->getFirstDomain());
233 DomainValue *Next = DV->Next;
234 DV->clear();
235 Avail.push_back(DV);
237 DV = Next;
244 DomainValue *DV = DVRef;
245 if (!DV || !DV->Next)
246 return DV;
248 // DV has a chain. Find the end.
249 do DV = DV->Next;
250 while (DV->Next);
252 // Update DVRef to point to DV.
253 retain(DV);
255 DVRef = DV;
256 return DV;
259 /// Set LiveRegs[rx] = dv, updating reference counts.
260 void ExeDepsFix::setLiveReg(int rx, DomainValue *dv) {
264 if (LiveRegs[rx].Value == dv)
268 LiveRegs[rx].Value = retain(dv);
286 if (DomainValue *dv = LiveRegs[rx].Value) {
287 if (dv->isCollapsed())
288 dv->addDomain(domain);
289 else if (dv->hasDomain(domain))
290 collapse(dv, domain);
294 collapse(dv, dv->getFirstDomain());
305 /// registers using dv, they each get a unique collapsed DomainValue.
306 void ExeDepsFix::collapse(DomainValue *dv, unsigned domain) {
307 assert(dv->hasDomain(domain) && "Cannot collapse");
310 while (!dv->Instrs.empty())
311 TII->setExecutionDomain(dv->Instrs.pop_back_val(), domain);
312 dv->setSingleDomain(domain);
315 if (LiveRegs && dv->Refs > 1)
317 if (LiveRegs[rx].Value == dv)
615 if (DomainValue *dv = LiveRegs[rx].Value) {
616 // Bitmask of domains that dv and available have in common.
617 unsigned common = dv->getCommonDomains(available);
619 if (dv->isCollapsed()) {
668 DomainValue *dv = nullptr;
670 if (!dv) {
671 dv = Regs.pop_back_val().Value;
672 // Force the first dv to match the current instruction.
673 dv->AvailableDomains = dv->getCommonDomains(available);
674 assert(dv->AvailableDomains && "Domain should have been filtered");
680 if (Latest == dv || Latest->Next)
682 if (merge(dv, Latest))
691 // dv is the DomainValue we are going to use for this instruction.
692 if (!dv) {
693 dv = alloc();
694 dv->AvailableDomains = available;
696 dv->Instrs.push_back(mi);
698 // Finally set all defs and non-collapsed uses to dv. We must iterate through
707 if (!LiveRegs[rx].Value || (mo.isDef() && LiveRegs[rx].Value != dv)) {
709 setLiveReg(rx, dv);