intel/compiler: Fix signed integer range analysis of imax and imin

Some review feedback of an earlier commit caused me to rearrange some
code quite a bit. I wasn't paying enough attention while applying the
later commits, and these breaks should have been returns. As it is, the
result of the imin or imax analysis is overwritten by the default case
handling... effectively the original commit does nothing. :(

Tiger Lake and Ice Lake had similar results. (Ice Lake shown)
total instructions in shared programs: 19914090 -> 19904772 (-0.05%)
instructions in affected programs: 121258 -> 111940 (-7.68%)
helped: 445 / HURT: 0

total cycles in shared programs: 855291535 -> 855266659 (<.01%)
cycles in affected programs: 2737005 -> 2712129 (-0.91%)
helped: 426 / HURT: 17

LOST:   0
GAINED: 3

Skylake and Broadwell had similar results. (Skylake shown)
total cycles in shared programs: 842395356 -> 842338259 (<.01%)
cycles in affected programs: 5460985 -> 5403888 (-1.05%)
helped: 458 / HURT: 0

Haswell and Ivy Bridge had similar results. (Haswell shown)
total instructions in shared programs: 16710449 -> 16708449 (-0.01%)
instructions in affected programs: 44101 -> 42101 (-4.54%)
helped: 75 / HURT: 0

total cycles in shared programs: 882760230 -> 882727923 (<.01%)
cycles in affected programs: 2867797 -> 2835490 (-1.13%)
helped: 62 / HURT: 10

No shader-db change on any other Intel platform.

No fossil-db changes on any Intel platform.

Fixes: 5ec75ca10d ("intel/compiler: Teach signed integer range analysis about imax and imin")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19602>
This commit is contained in:
Ian Romanick
2022-11-07 23:24:24 -08:00
committed by Marge Bot
parent 0f81d9bc88
commit d668512f88

View File

@@ -135,7 +135,8 @@ signed_integer_range_analysis(nir_shader *shader, struct hash_table *range_ht,
*lo = MAX2(src0_lo, src1_lo);
*hi = MAX2(src0_hi, src1_hi);
break;
return non_unary;
}
case nir_op_imin: {
@@ -151,7 +152,8 @@ signed_integer_range_analysis(nir_shader *shader, struct hash_table *range_ht,
*lo = MIN2(src0_lo, src1_lo);
*hi = MIN2(src0_hi, src1_hi);
break;
return non_unary;
}
default: