Skip to content

Commit

Permalink
hoist redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
calebmkim committed Apr 1, 2024
1 parent 4b749f0 commit fe911c6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/scala/backends/calyx/Backend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,9 @@ private class CalyxBackendHelper {
}
case CEmpty => (List(), Empty, store)
case wh @ CWhile(cond, _, body) => {
val (bodyStruct, bodyCon, st) = emitCmd(body)
wh.attributes.get("bound") match {
case Some(count) => {
val (bodyStruct, bodyCon, st) = emitCmd(body)
val control = Repeat(count, bodyCon)
(bodyStruct, control, st)
}
Expand All @@ -959,7 +959,6 @@ private class CalyxBackendHelper {
condOut.delay,
true
)
val (bodyStruct, bodyCon, st) = emitCmd(body)
val control = While(condOut.port, condGroup.id, bodyCon)
control.attributes = wh.attributes
(condGroup :: bodyStruct ++ condDefs, control, st)
Expand Down

0 comments on commit fe911c6

Please sign in to comment.