nir: Transform discard_if(true) into discard
authorMatt Turner <mattst88@gmail.com>
Fri, 27 Apr 2018 04:25:42 +0000 (21:25 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 7 May 2018 20:50:23 +0000 (13:50 -0700)
commited5af9437344f932f8cbebfa776f873d16a8aae1
tree6557d41cb571475baf6dd9a3a935869879cabf90
parentea1fff4416036066cff51826f95b4703d7211008
nir: Transform discard_if(true) into discard

Noticed while reviewing Tim Arceri's NIR inlining series.

Without his series:

instructions in affected programs: 16 -> 14 (-12.50%)
helped: 2

With his series:

instructions in affected programs: 196 -> 174 (-11.22%)
helped: 22

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opt_constant_folding.c