diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-11-08 23:26:00 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-11-08 23:26:00 +0000 |
commit | b7e44a3f5f721deff3f85fc5cf62fa8cf4fbc40a (patch) | |
tree | 10b70147135cc4389188cfd03b5b935f04903d74 /llvm/lib/CodeGen/ExecutionDepsFix.cpp | |
parent | 485eceed38debe7748351770a807e99764156fbc (diff) | |
download | bcm5719-llvm-b7e44a3f5f721deff3f85fc5cf62fa8cf4fbc40a.tar.gz bcm5719-llvm-b7e44a3f5f721deff3f85fc5cf62fa8cf4fbc40a.zip |
Track reference count independently from clear().
This allows clear() to be called on a DomainValue with references.
llvm-svn: 144147
Diffstat (limited to 'llvm/lib/CodeGen/ExecutionDepsFix.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ExecutionDepsFix.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/ExecutionDepsFix.cpp b/llvm/lib/CodeGen/ExecutionDepsFix.cpp index 5a75fde2d6d..9a7a2890efc 100644 --- a/llvm/lib/CodeGen/ExecutionDepsFix.cpp +++ b/llvm/lib/CodeGen/ExecutionDepsFix.cpp @@ -92,10 +92,10 @@ struct DomainValue { return CountTrailingZeros_32(AvailableDomains); } - DomainValue() { clear(); } + DomainValue() : Refs(0) { clear(); } void clear() { - Refs = AvailableDomains = Dist = 0; + AvailableDomains = Dist = 0; Instrs.clear(); } }; @@ -173,6 +173,7 @@ DomainValue *ExeDepsFix::alloc(int domain) { dv->Dist = Distance; if (domain >= 0) dv->addDomain(domain); + assert(dv->Refs == 0 && "Reference count wasn't cleared"); return dv; } @@ -271,8 +272,7 @@ bool ExeDepsFix::merge(DomainValue *A, DomainValue *B) { A->Instrs.append(B->Instrs.begin(), B->Instrs.end()); // Clear the old DomainValue so we won't try to swizzle instructions twice. - B->Instrs.clear(); - B->AvailableDomains = 0; + B->clear(); for (unsigned rx = 0; rx != NumRegs; ++rx) if (LiveRegs[rx] == B) |