• Timothy Arceri's avatar
    nir: add loop unroll support for complex wrapper loops · e7f2c8c9
    Timothy Arceri authored
    In GLSL IR we cheat with switch statements and simply convert them
    into loops with a single iteration. This allowed us to make use of
    the existing jump instruction handling provided by the loop handing
    code, it also allows dead code to be cleaned up once we have
    wrapped the code in a loop.
    
    However using loops in this way created previously unrollable loops
    which limits further optimisations. Here we provide a way to unroll
    loops that end in a break and have multiple other exits.
    
    All shader-db changes are from the dolphin uber shaders. There is a
    small amount of HURT shaders but in general the improvements far
    exceed the HURT.
    
    shader-db results IVB:
    
    total instructions in shared programs: 10018187 -> 10016468 (-0.02%)
    instructions in affected programs: 104080 -> 102361 (-1.65%)
    helped: 36
    HURT: 15
    
    total cycles in shared programs: 220065064 -> 154529655 (-29.78%)
    cycles in affected programs: 126063017 -> 60527608 (-51.99%)
    helped: 51
    HURT: 0
    
    total loops in shared programs: 2515 -> 2308 (-8.23%)
    loops in affected programs: 903 -> 696 (-22.92%)
    helped: 51
    HURT: 0
    
    total spills in shared programs: 4370 -> 4124 (-5.63%)
    spills in affected programs: 1397 -> 1151 (-17.61%)
    helped: 9
    HURT: 12
    
    total fills in shared programs: 4581 -> 4419 (-3.54%)
    fills in affected programs: 2201 -> 2039 (-7.36%)
    helped: 9
    HURT: 15
    e7f2c8c9
Name
Last commit
Last update
bin Loading commit data...
build-support Loading commit data...
docs Loading commit data...
doxygen Loading commit data...
include Loading commit data...
m4 Loading commit data...
scons Loading commit data...
scripts Loading commit data...
src Loading commit data...
.dir-locals.el Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
Android.common.mk Loading commit data...
Android.mk Loading commit data...
CleanSpec.mk Loading commit data...
Makefile.am Loading commit data...
README.rst Loading commit data...
REVIEWERS Loading commit data...
SConstruct Loading commit data...
VERSION Loading commit data...
appveyor.yml Loading commit data...
autogen.sh Loading commit data...
common.py Loading commit data...
configure.ac Loading commit data...
install-gallium-links.mk Loading commit data...
install-lib-links.mk Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...