Lines Matching refs:domain
19 // This pass changes the variant instructions to minimize domain crossings.
43 /// execution domain. Multiple registers may refer to the same open
45 /// domain.
51 /// domain, but if we were forced to pay the penalty of a domain crossing, we
76 // Is domain available?
77 bool hasDomain(unsigned domain) const {
78 assert(domain <
81 return AvailableDomains & (1u << domain);
84 // Mark domain as available.
85 void addDomain(unsigned domain) {
86 AvailableDomains |= 1u << domain;
89 // Restrict to a single domain available.
90 void setSingleDomain(unsigned domain) {
91 AvailableDomains = 1u << domain;
99 // First domain available.
180 DomainValue *alloc(int domain = -1);
191 void force(int rx, unsigned domain);
192 void collapse(DomainValue *dv, unsigned domain);
200 void visitHardInstr(MachineInstr*, unsigned domain);
217 DomainValue *ExeDepsFix::alloc(int domain) {
221 if (domain >= 0)
222 dv->addDomain(domain);
289 /// Force register rx into domain.
290 void ExeDepsFix::force(int rx, unsigned domain) {
295 dv->addDomain(domain);
296 else if (dv->hasDomain(domain))
297 collapse(dv, domain);
300 // force the new value into domain. This costs a domain crossing.
303 LiveRegs[rx].Value->addDomain(domain);
307 setLiveReg(rx, alloc(domain));
311 /// Collapse open DomainValue into given domain. If there are multiple
313 void ExeDepsFix::collapse(DomainValue *dv, unsigned domain) {
314 assert(dv->hasDomain(domain) && "Cannot collapse");
318 TII->setExecutionDomain(dv->Instrs.pop_back_val(), domain);
319 dv->setSingleDomain(domain);
325 setLiveReg(rx, alloc(domain));
415 unsigned Domain = LiveRegs[rx].Value->getFirstDomain();
416 if (!pdv->isCollapsed() && pdv->hasDomain(Domain))
417 collapse(pdv, Domain);
579 // A hard instruction only works in one domain. All input registers will be
580 // forced into that domain.
581 void ExeDepsFix::visitHardInstr(MachineInstr *mi, unsigned domain) {
588 force(rx, domain);
598 force(rx, domain);
625 // If there are no common domains, we must pay the cross-domain
638 // If the collapsed operands force a single domain, propagate the collapse.
640 unsigned domain = countTrailingZeros(available);
641 TII->setExecutionDomain(mi, domain);
642 visitHardInstr(mi, domain);
679 assert(dv->AvailableDomains && "Domain should have been filtered");