From: Eric Anholt Date: Wed, 6 Jul 2016 22:00:45 +0000 (-0700) Subject: nir: Add optimization for (a || True == True) X-Git-Tag: upstream/17.1.0~8113 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c93f6938d5dac1cfbeae7040929c232d70b6feae;p=platform%2Fupstream%2Fmesa.git nir: Add optimization for (a || True == True) This was appearing in vc4 VS/CS in mupen64, due to vertex attrib lowering producing some constants that were getting compared. total instructions in shared programs: 112276 -> 112198 (-0.07%) instructions in affected programs: 2239 -> 2161 (-3.48%) total estimated cycles in shared programs: 283102 -> 283038 (-0.02%) estimated cycles in affected programs: 2365 -> 2301 (-2.71%) Reviewed-by: Jason Ekstrand --- diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index fd22801..7d04ef9 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -197,6 +197,7 @@ optimizations = [ (('iand', a, 0), 0), (('ior', a, a), a), (('ior', a, 0), a), + (('ior', a, True), True), (('fxor', a, a), 0.0), (('ixor', a, a), 0), (('ixor', a, 0), a),