anv: Disable __gen_validate_value if NDEBUG is set.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 7 Jun 2018 22:44:43 +0000 (15:44 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 11 Jun 2018 21:55:32 +0000 (14:55 -0700)
commit0d5329d626e3f96a7788880052ae2a5ecfc8cdbe
tree62d3344f2cab0c618c466e2e76a360877c206808
parent06e8771decaad62089e1c7e75905683ae12bc12f
anv: Disable __gen_validate_value if NDEBUG is set.

We were enabling undefined memory checking for genxml values based on
Valgrind being installed at build time, even for release builds.  This
generates piles and piles of assembly whenever you touch genxml.

With gcc 7.3.1 and -O3 and -march=native on a Kabylake with Valgrind
installed at build time:

      text    data    bss     dec    hex filename
   5978385  262884  13488 6254757 5f70a5 libvulkan_intel.so
   3799377  262884  13488 4075749 3e30e5 libvulkan_intel.so

That's a 36% reduction in text size.

Fixes: 047ed02723071d7eccbed3210b5be6ae73603a53 (vk/emit: Use valgrind to validate every packed field)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_private.h