From 0fca90f951fa91c944c68bffef1c91f74d563028 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 22 Jun 2017 17:34:19 -0700 Subject: Speed up ConstProp by doing ConstProp before recording node Similar to #543 --- src/main/scala/firrtl/passes/ConstProp.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/scala/firrtl/passes/ConstProp.scala b/src/main/scala/firrtl/passes/ConstProp.scala index bb3fb1e8..8a2d6ec6 100644 --- a/src/main/scala/firrtl/passes/ConstProp.scala +++ b/src/main/scala/firrtl/passes/ConstProp.scala @@ -253,11 +253,12 @@ object ConstProp extends Pass { } def constPropStmt(s: Statement): Statement = { - s match { + val stmtx = s map constPropStmt map constPropExpression + stmtx match { case x: DefNode => nodeMap(x.name) = x.value case _ => } - s map constPropStmt map constPropExpression + stmtx } val res = Module(m.info, m.name, m.ports, constPropStmt(m.body)) -- cgit v1.2.3