Emit: Remove emitVarCmtChg

emitVarCmtChg used to emit MTask affinity of variables in comments in
the generated header. This causes unnecessary changes in the output when
scheduling changes slightly between compilation, hindering ccache reuse.
If needing this info for debugging Verilator, add a separate dump file
instead of emitting it in the generated code.
This commit is contained in:
Geza Lore 2021-06-16 13:02:46 +01:00
parent a8f83d5758
commit 6c332a2f8e
3 changed files with 1 additions and 21 deletions

View File

@ -640,13 +640,6 @@ AstVar* AstVar::scVarRecurse(AstNode* nodep) {
return nullptr;
}
string AstVar::mtasksString() const {
std::ostringstream os;
os << "all: ";
for (const auto& id : m_mtaskIds) os << id << " ";
return os.str();
}
class AstNodeDType::CTypeRecursed final {
public:
string m_type; // The base type, e.g.: "Foo_t"s

View File

@ -2227,7 +2227,6 @@ public:
void addProducingMTaskId(int id) { m_mtaskIds.insert(id); }
void addConsumingMTaskId(int id) { m_mtaskIds.insert(id); }
const MTaskIdSet& mtaskIds() const { return m_mtaskIds; }
string mtasksString() const;
};
class AstDefParam final : public AstNode {

View File

@ -124,13 +124,6 @@ public:
puts("[" + cvtToStr(arrayp->elementsConst()) + "]");
}
}
void emitVarCmtChg(const AstVar* varp, string* curVarCmtp) {
string newVarCmt = varp->mtasksString();
if (*curVarCmtp != newVarCmt) {
*curVarCmtp = newVarCmt;
if (v3Global.opt.threads()) puts("// Begin mtask footprint " + *curVarCmtp + "\n");
}
}
void emitTypedefs(AstNode* firstp) {
bool first = true;
for (AstNode* loopp = firstp; loopp; loopp = loopp->nextp()) {
@ -3097,7 +3090,6 @@ void EmitCStmts::emitSortedVarList(const VarVec& anons, const VarVec& nonanons,
if (anonL1s != 1) puts("struct {\n");
for (int l0 = 0; l0 < lim && it != anons.cend(); ++l0) {
const AstVar* varp = *it;
emitVarCmtChg(varp, &curVarCmt);
emitVarDecl(varp, prefixIfImp);
++it;
}
@ -3110,15 +3102,11 @@ void EmitCStmts::emitSortedVarList(const VarVec& anons, const VarVec& nonanons,
// Leftovers, just in case off by one error somewhere above
for (; it != anons.end(); ++it) {
const AstVar* varp = *it;
emitVarCmtChg(varp, &curVarCmt);
emitVarDecl(varp, prefixIfImp);
}
}
// Output nonanons
for (const AstVar* varp : nonanons) {
emitVarCmtChg(varp, &curVarCmt);
emitVarDecl(varp, prefixIfImp);
}
for (const AstVar* varp : nonanons) { emitVarDecl(varp, prefixIfImp); }
}
void EmitCImp::emitThreadingState() {