nir: Convert ineg(b2i(a)) to a if it's a boolean.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 9 Aug 2016 00:05:18 +0000 (17:05 -0700)
committerTimothy Arceri <timothy.arceri@collabora.com>
Mon, 9 Jan 2017 01:32:16 +0000 (12:32 +1100)
commit1c50d31c2613ec41d53fc784c59708e4d271f9b4
treed8b6f65363a00113ce8519f667639f02bb91dc67
parent86b9be777f11b1226565350363e6b39f7b2f22c8
nir: Convert ineg(b2i(a)) to a if it's a boolean.

On BDW:

total instructions in shared programs: 13071119 -> 13070371 (-0.01%)
instructions in affected programs: 83424 -> 82676 (-0.90%)
helped: 505
HURT: 45 (all TCS, all hurt by a single instruction)

total cycles in shared programs: 256601322 -> 256588932 (-0.00%)
cycles in affected programs: 819410 -> 807020 (-1.51%)
helped: 450
HURT: 57

total loops in shared programs: 2950 -> 2942 (-0.27%)
loops in affected programs: 8 -> 0
helped: 7
HURT: 0

v2: Drop unnecessary 'a@bool' annotation (Connor, Eric).
    Add a comment explaining the rule (Ian).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/nir/nir_opt_algebraic.py