OSDN Git Service

glsl: Squish ir_variable::max_ifc_array_access and ::state_slots together
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 28 May 2014 01:34:24 +0000 (18:34 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 30 Sep 2014 20:34:42 +0000 (13:34 -0700)
commita32ac726ee8825c8352337a0489dddaffd955d4a
treefec2b53f6d84c411f2268add7ef658e93483130a
parent5aa8d8194c4975876276a9c57cdd672978a491ad
glsl: Squish ir_variable::max_ifc_array_access and ::state_slots together

At least one of these pointers must be NULL, and we can determine which
will be NULL by looking at other fields.  Use this information to store
both pointers in the same location.

If anyone can think of a better name for the union than "u", I'm all
ears.

Valgrind massif results for a trimmed apitrace of dota2:

                  n        time(i)         total(B)   useful-heap(B) extra-heap(B)    stacks(B)
Before (32-bit): 63 40,574,239,515       68,117,280       62,618,607     5,498,673            0
After  (32-bit): 44 40,577,049,140       68,118,608       62,441,063     5,677,545            0

Before (64-bit): 53 37,126,451,468       95,150,256       87,711,304     7,438,952            0
After  (64-bit): 63 37,122,829,194       95,153,008       87,333,600     7,819,408            0

A real savings of 173KiB on 32-bit and 368KiB on 64-bit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/glsl/ir.cpp
src/glsl/ir.h
src/glsl/ir_clone.cpp