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.