Optimize VL_SFORMAT when result is string (#7702)

Omit unused bit width parameter. Emit rule is simple enough to change
and the unused parameter just bloats code size.
This commit is contained in:
Geza Lore
2026-06-03 08:42:48 +01:00
committed by GitHub
parent 970e7983d3
commit efb83c55de
3 changed files with 7 additions and 7 deletions
+4 -2
View File
@@ -224,8 +224,10 @@ bool EmitCFunc::displayEmitHeader(AstNode* nodep) {
} else if (const AstSFormat* const dispp = VN_CAST(nodep, SFormat)) {
isStmt = true;
puts("VL_SFORMAT_NX(");
puts(cvtToStr(dispp->lhsp()->widthMin()));
putbs(",");
if (!dispp->lhsp()->dtypep()->isString()) {
puts(cvtToStr(dispp->lhsp()->widthMin()));
putbs(",");
}
iterateConst(dispp->lhsp());
emitDatap(dispp->lhsp());
putbs(",");