Home | History | Annotate | Download | only in CodeGen

Lines Matching defs:dv

168   DomainValue *retain(DomainValue *DV) {
169 if (DV) ++DV->Refs;
170 return DV;
176 void setLiveReg(int rx, DomainValue *DV);
179 void collapse(DomainValue *dv, unsigned domain);
201 DomainValue *dv = Avail.empty() ?
205 dv->addDomain(domain);
206 assert(dv->Refs == 0 && "Reference count wasn't cleared");
207 assert(!dv->Next && "Chained DomainValue shouldn't have been recycled");
208 return dv;
211 /// release - Release a reference to DV. When the last reference is released,
213 void ExeDepsFix::release(DomainValue *DV) {
214 while (DV) {
215 assert(DV->Refs && "Bad DomainValue");
216 if (--DV->Refs)
219 // There are no more DV references. Collapse any contained instructions.
220 if (DV->AvailableDomains && !DV->isCollapsed())
221 collapse(DV, DV->getFirstDomain());
223 DomainValue *Next = DV->Next;
224 DV->clear();
225 Avail.push_back(DV);
227 DV = Next;
234 DomainValue *DV = DVRef;
235 if (!DV || !DV->Next)
236 return DV;
238 // DV has a chain. Find the end.
239 do DV = DV->Next;
240 while (DV->Next);
242 // Update DVRef to point to DV.
243 retain(DV);
245 DVRef = DV;
246 return DV;
249 /// Set LiveRegs[rx] = dv, updating reference counts.
250 void ExeDepsFix::setLiveReg(int rx, DomainValue *dv) {
254 if (LiveRegs[rx].Value == dv)
258 LiveRegs[rx].Value = retain(dv);
276 if (DomainValue *dv = LiveRegs[rx].Value) {
277 if (dv->isCollapsed())
278 dv->addDomain(domain);
279 else if (dv->hasDomain(domain))
280 collapse(dv, domain);
284 collapse(dv, dv->getFirstDomain());
295 /// registers using dv, they each get a unique collapsed DomainValue.
296 void ExeDepsFix::collapse(DomainValue *dv, unsigned domain) {
297 assert(dv->hasDomain(domain) && "Cannot collapse");
300 while (!dv->Instrs.empty())
301 TII->setExecutionDomain(dv->Instrs.pop_back_val(), domain);
302 dv->setSingleDomain(domain);
305 if (LiveRegs && dv->Refs > 1)
307 if (LiveRegs[rx].Value == dv)
546 if (DomainValue *dv = LiveRegs[rx].Value) {
547 // Bitmask of domains that dv and available have in common.
548 unsigned common = dv->getCommonDomains(available);
550 if (dv->isCollapsed()) {
599 DomainValue *dv = 0;
601 if (!dv) {
602 dv = Regs.pop_back_val().Value;
603 // Force the first dv to match the current instruction.
604 dv->AvailableDomains = dv->getCommonDomains(available);
605 assert(dv->AvailableDomains && "Domain should have been filtered");
611 if (Latest == dv || Latest->Next)
613 if (merge(dv, Latest))
622 // dv is the DomainValue we are going to use for this instruction.
623 if (!dv) {
624 dv = alloc();
625 dv->AvailableDomains = available;
627 dv->Instrs.push_back(mi);
629 // Finally set all defs and non-collapsed uses to dv. We must iterate through
638 if (!LiveRegs[rx].Value || (mo.isDef() && LiveRegs[rx].Value != dv)) {
640 setLiveReg(rx, dv);