Optimize conditional merging across some impure statements (#7159)

- Allow reordering pure statements with DPI import calls iff no public
  variables (including those read via a DPI export) are involved. This
  ensures the DPI import can't observe the reordering
- Allow reordering of pure statements with AstDisplay and AstStop. This
  requires an assumption that AstDisplay and AstStop will not read or
  write model state other than via a VarRef explicitly present int the
  Ast.
Overall this allows eliminating a lot of conditionals around assertions,
which were previously not possible.
This commit is contained in:
Geza Lore
2026-03-01 05:47:05 -05:00
committed by GitHub
parent 26eac21432
commit 77ce9cec1e
10 changed files with 1394 additions and 1339 deletions
+2 -1
View File
@@ -765,7 +765,8 @@ class TaskVisitor final : public VNVisitor {
// __Vscopep
ccallp->addArgsp(snp);
// __Vfilenamep
ccallp->addArgsp(new AstCExpr{flp, "\"" + flp->filenameEsc() + "\"", 64});
ccallp->addArgsp(
new AstCExpr{flp, AstCExpr::Pure{}, "\"" + flp->filenameEsc() + "\"", 64});
// __Vlineno
ccallp->addArgsp(new AstConst(flp, flp->lineno()));
}