clash-lang / clash-compiler

Haskell to VHDL/Verilog/SystemVerilog compiler
https://clash-lang.org/
Other
1.4k stars 149 forks source link

Give evaluator acces to inscope let-bindings #2571

Closed christiaanb closed 8 months ago

christiaanb commented 11 months ago

Without it, Clash goes into an infinite loop on T1354A in combination with: https://github.com/clash-lang/ghc-typelits-knownnat/pull/47

There is a tiny performance regression.

Before:

$ cabal run clash-benchmark-normalization -- examples/Reducer.hs --time-limit 30
GHC: Setting up GHC took: 0.489s
GHC: Compiling and loading modules took: 1.125s
Clash: Parsing and compiling primitives took 0.159s
benchmarking normalization of examples/Reducer.hs
time                 684.4 ms   (674.0 ms .. 694.0 ms)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 680.6 ms   (674.9 ms .. 684.7 ms)
std dev              8.784 ms   (4.641 ms .. 12.23 ms)
variance introduced by outliers: 11% (moderately inflated)

after:

$ cabal run clash-benchmark-normalization -- examples/Reducer.hs --time-limit 30
GHC: Setting up GHC took: 0.496s
GHC: Compiling and loading modules took: 1.135s
Clash: Parsing and compiling primitives took 0.157s
benchmarking normalization of examples/Reducer.hs
time                 696.5 ms   (689.5 ms .. 711.9 ms)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 687.1 ms   (679.4 ms .. 692.8 ms)
std dev              11.01 ms   (8.152 ms .. 15.16 ms)
variance introduced by outliers: 11% (moderately inflated)
leonschoorl commented 11 months ago

When you rebase that ffi:example failure should now be solved