Commit Graph

8 Commits

Author SHA1 Message Date
Geza Lore e494cf22a4
Add DfgPeephole patterns (#6149) 2025-07-07 16:25:29 +01:00
Geza Lore 7a3f1f16ca
Optimize DFG before V3Gate (#6141) 2025-07-01 17:55:08 -04:00
Yutetsu TAKATSUKASA 100e3d7702
Fix const-bit-op-tree with single-bit masks (#5993) (#5998) 2025-05-10 06:01:15 -04:00
Wilson Snyder abc46db3c0 Tests: Cleanup some .cpp paths. No test functional change indended. 2025-04-25 20:57:11 -04:00
Geza Lore d9701e6406
Automatically split some packed variables (#5843)
This patch adds a heuristic to V3SplitVar, and it attempts to split up
packed variables that are only referenced via constant index,
non-overlapping bit/range selects. This can eliminate some UNOPTFLAT cases.
2025-03-09 10:31:01 -04:00
Geza Lore 03bd1bfc63
Move Concat balancing from DFG to FuncOpt (#5602)
This means it applies more widely, e.g. inside sequential logic.
2024-11-10 17:23:11 +00:00
Geza Lore f073b278f9
Balance concatenations in DFG (#5598)
The DFG peephole pass converts all associative trees into right leaning,
which is good for simplifying pattern recognition, but can lead to an
excessive amount of wide intermediate results being constructed for
right leaning concatenations.

Add a new pass to balance concatenation trees by trying to:
- Create VL_EDATASIZE (32-bit) sub-terms, so words can then be packed
  easily afterwards
- Try to ensure the operands of a concat are roughly the same width
  within a concatenation tree. This does not yield the shortest tree,
  but it ensures it has many sub-nodes that are small enough to fit into
  machine registers.

This can eliminate a lot of wide intermediate results, which would need
temporaries, and also increases ILP within sub-expressions (assuming the
C compiler can't figure that out itself).

This is over 2x run-time speedup on the high_perf configuration of
VeeR EH2 (which you could arguably also get with -fno-dfg, but oh well).
2024-11-09 18:14:19 +00:00
Wilson Snyder 2c52119d6c Tests: Rename some tests into proper groups. No functional change. 2024-09-21 10:04:58 -04:00