Commit Graph

3 Commits

Author SHA1 Message Date
Peterino2 0ba9de16fa documentation updates 2026-11-04 08:51:40 -07:00
peterino2 ddefd450f7 dxil: smaller code, as dxc's optimizer makes it
Unreal's 11,488 compiles came out 1.7 times dxc's DXIL; now 1.09.

- cfg.zig: blocks that only branch to a block with no other
  predecessor take it in; blocks holding only a branch are bypassed;
  if/else arms with up to two cheap instructions become selects (dxc's
  simplifycfg); a branch or switch going one way everywhere goes there.
- cse.zig: repeated computations over the dominator tree (arithmetic,
  readnone dx.ops, cbuffer loads, handles), as EarlyCSE and GVN.
- promote: floating-point constants folded (arithmetic, FAbs, Saturate,
  rounding, Sqrt, min/max), `zext i1 != 0`, `and` by known-zero bits,
  and compares of selects and phis of constants (`(c ? 2 : 1) == 3`).
- [unroll] loops: their back edge is marked for the unroller, which
  unrolls them up to dxc's 1024 iterations whatever their size.
- -Od promotes locals and removes dead code, as dxc's does: 14 times
  dxc's size before, 0.89 now.

Every compile validates with Unreal's validator 1.8. Compile time
over the corpus: 584 s summed, 539 before.
2026-11-03 19:45:14 -08:00
Peterino2 57800241e9 shorter readme, new manual 2026-11-03 09:15:14 -07:00