diff options
| author | Jack Koenig | 2017-06-22 17:34:19 -0700 |
|---|---|---|
| committer | Jack Koenig | 2017-06-26 17:17:49 -0700 |
| commit | 0fca90f951fa91c944c68bffef1c91f74d563028 (patch) | |
| tree | 7335cfb63415f9d7935bce3cd55f3374d0428a05 | |
| parent | 5135e9c6aeb1c9d472a5b29adb44a4acaf504fb8 (diff) | |
Speed up ConstProp by doing ConstProp before recording node
Similar to #543
| -rw-r--r-- | src/main/scala/firrtl/passes/ConstProp.scala | 5 |
1 files changed, 3 insertions, 2 deletions
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)) |
