8000 Improve V3Premit · gezalore/verilator@9a6e6f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a6e6f5

Browse files
committed
Improve V3Premit
- Enable creating constant pool entries for RHS of simple var = const assignments - Never extract ArraySel (it's just pointer arithmetic) - Remove unnecessary AstTraceInc precond child tree - Always fully recurse expressions (fix transplanted from verilator#4617) - General cleanup Overall the patch is performance neutral to slightly positive, but saves ~10% peak Verialtor memory usage due to not creating temporaries (which are later expanded) for any ArraySels.
1 parent 5d99534 commit 9a6e6f5

File tree

4 files changed

+149
-191
lines changed

4 files changed

+149
-191
lines changed

src/V3AstNodeOther.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3253,8 +3253,7 @@ class AstTraceDecl final : public AstNodeStmt {
32533253
};
32543254
class AstTraceInc final : public AstNodeStmt {
32553255
// Trace point dump
3256-
// @astgen op1 := precondsp : List[AstNode] // Statements to emit before this node
3257-
// @astgen op2 := valuep : AstNodeExpr // Expression being traced (from decl)
3256+
// @astgen op1 := valuep : AstNodeExpr // Expression being traced (from decl)
32583257
//
32593258
// @astgen ptr := m_declp : AstTraceDecl // Pointer to declaration
32603259
const uint32_t m_baseCode; // Trace code base value in function containing this AstTraceInc

src/V3EmitCImp.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ class EmitCTrace final : EmitCFunc {
740740
}
741741

742742
void emitTraceChangeOne(AstTraceInc* nodep, int arrayindex) {
743-
iterateAndNextConstNull(nodep->precondsp());
744743
// Note: Both VTraceType::CHANGE and VTraceType::FULL use the 'full' methods
745744
const std::string func = nodep->traceType() == VTraceType::CHANGE ? "chg" : "full";
746745
bool emitWidth = true;

0 commit comments

Comments
 (0)
0