nir,spirv: Optimize inbounds access chains
fossil-db (navi22):
PERCENTAGE DELTAS Shaders CodeSize Instrs Latency InvThroughput
test_dynamic 1 -30.00% -28.57% -3.21% -2.70%
test_uniform 1 -18.18% -25.00% -2.86% -4.17%
-----------------------------------------------------------------------
All affected 2 -23.81% -26.67% -3.07% -3.28%
-----------------------------------------------------------------------
Total 2 -23.81% -26.67% -3.07% -3.28%
/cc @jekstrand @themaister
Edited by Konstantin Seurer