OSDN Git Service

i965: Sweep NIR after linking phase to free held memory
authorDanylo Piliaiev <danylo.piliaiev@gmail.com>
Wed, 11 Jul 2018 12:29:00 +0000 (15:29 +0300)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 18 Jul 2018 16:00:18 +0000 (09:00 -0700)
commitd219521379626ebf2bff63e4a9c2f92725b3926a
treee0f7e0f915471c9ecf205e7e772afac7e88a901a
parent51d6b163da1faa01e95cfd2f3493a843285a7ce9
i965: Sweep NIR after linking phase to free held memory

After optimization passes and many trasfromations most of memory
NIR holds is a garbage which was being freed only after shader deletion.
Freeing it at the end of linking will save memory which would be useful
in case there are a lot of complex shaders being compiled.
The common case for this issue is 32bit game running under Wine.

The cost of the optimization is around ~3-5% of compilation speed
with complex shaders.

V2: by Jason Ekstrand
    - Move nir_sweep up, right after the last change of NIR

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103274
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
src/mesa/drivers/dri/i965/brw_link.cpp