question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slow "common subexpression elimination" pass with large ROM design.

See original GitHub issue

My design has lots of constants, and it doesn’t scale well with design size. Generating the FIRRTL is quick, but FIRRTL is very slow during the “common subexpression elimination” pass relative to all the other passes. I assume this is because it’s trying to optimize a large ROM. Maybe this behavior is expected, but it would be nice to have a faster version, whether through better handling of this case or an option to turn off this pass.

The FIRRTL files and “log-level info” outputs for 4 design sizes are in /nscratch/stevo/firrtl-test.

This can also be replicated by compiling the FFT yourself. Clone the FFT repo (follow the setup instructions in the README), and change the design size (here) to 256, 512, 1024, or 2048. Compile with make verilog CONFIG=CustomStandaloneFFTConfig.

compile_time

firrtl_size

verilog_size

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
stevobaileycommented, Feb 21, 2017

Update: Yes, this improves performance noticeably. CSE went from 586140ms to 1638ms for the 2048-point FFT! I.e. 10 minutes to less than 2 seconds.

1reaction
stevobaileycommented, Feb 20, 2017

Thanks, I get a little overzealous in prioritizing one-liners over efficient code, haha.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slow "common subexpression elimination" pass with large ...
My design has lots of constants, and it doesn't scale well with design size. Generating the FIRRTL is quick, but FIRRTL is very...
Read more >
A Greedy Common Subexpression Elimination Algorithm for ...
A greedy common subexpression elimination (CSE) algorithm with a look-ahead method based on the canonic signed digit (CSD) representation of ...
Read more >
Using the GNU Compiler Collection (GCC): Optimize Options
When -fgcse-sm is enabled, a store motion pass is run after global common subexpression elimination. This pass attempts to move stores out of...
Read more >
understanding and improving the performance of modern
in modern languages typically run slower than those written in traditional ... 6.1 Code Hoisting and Common Subexpression Elimination for Memory Ref-.
Read more >
Simple, Light, Yet Formally Verified, Global Common ...
invariant code motion optimization by composing an unrolling pass and a formally certified yet efficient global subexpression elimination.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found