diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2019-08-06 13:14:27 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2019-08-28 11:45:34 -0700 |
commit | 16fadf1ca4e58f2dd34634abf0a8811d5d1c9ca2 (patch) | |
tree | 30eddc3d2581a9173d014623338d166e18586b62 | |
parent | 4662b70d23c2eed9b891e9694d956a1a2a37ab70 (diff) |
WIP: nir/algebraic: Reassociate shift-by-constant of shift-of-constantexperiment/optimize-shifts
No shader-db changes on any Intel platform.
-rw-r--r-- | src/compiler/nir/nir_opt_algebraic.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index beb7f7978f9..6d5c4f5d5b3 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -250,6 +250,10 @@ for s in [8, 16, 32, 64]: ]) optimizations.extend([ + (('ishl', ('ishl', '#a', b), '#c'), ('ishl', ('ishl', a, c), b)), + (('ishr', ('ishr', '#a', b), '#c'), ('ishr', ('ishr', a, c), b)), + (('ushr', ('ushr', '#a', b), '#c'), ('ushr', ('ushr', a, c), b)), + # This is common for address calculations. Reassociating may enable the # 'a<<c' to be CSE'd. It also helps architectures that have an ISHLADD # instruction or a constant offset field for in load / store instructions. |