nir/large_constants: Use dominance information to find more constants
Relax the restriction that all the writes need to be in the first block: now accept variables that have all the writes in the same block, and all the reads are dominated by that block.
This let the pass identify large constants that are local to a helper function. The writes will be at the place that the function is inlined, possibly not in the first block (but still all in the same block).
Results for vkpipeline-db in SKL:
total instructions in shared programs: 3655799 -> 3654053 (-0.05%)
instructions in affected programs: 79452 -> 77706 (-2.20%)
helped: 16
HURT: 0
total cycles in shared programs: 1448655344 -> 1448652934 (<.01%)
cycles in affected programs: 30155012 -> 30152602 (<.01%)
helped: 14
HURT: 2
total loops in shared programs: 2436 -> 2436 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0
total spills in shared programs: 6820 -> 6752 (-1.00%)
spills in affected programs: 2894 -> 2826 (-2.35%)
helped: 8
HURT: 0
total fills in shared programs: 20862 -> 20784 (-0.37%)
fills in affected programs: 12248 -> 12170 (-0.64%)
helped: 6
HURT: 2
LOST: 0
GAINED: 0
Edited by Caio Oliveira