<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 7, 2018 at 4:02 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We were enabling undefined memory checking for genxml values based on<br>
Valgrind being installed at build time, even for release builds. This<br>
generates piles and piles of assembly whenever you touch genxml.<br>
<br>
With gcc 7.3.1 and -O3 and -march=native on a Kabylake with Valgrind<br>
installed at build time:<br>
<br>
text data bss dec hex filename<br>
5978385 262884 13488 6254757 5f70a5 libvulkan_intel.so<br>
3799377 262884 13488 4075749 3e30e5 libvulkan_intel.so<br>
<br>
That's a 36% reduction in text size.<br>
---<br>
src/intel/vulkan/anv_private.h | 2 ++<br>
1 file changed, 2 insertions(+)<br>
<br>
Eric,<br>
<br>
You probably will want to make the equivalent change in<br>
src/broadcom/cle/v3d_packet_<wbr>helpers.h<br>
<br>
--Ken<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>private.h b/src/intel/vulkan/anv_<wbr>private.h<br>
index b47420f89ec..b035bf1c943 100644<br>
--- a/src/intel/vulkan/anv_<wbr>private.h<br>
+++ b/src/intel/vulkan/anv_<wbr>private.h<br>
@@ -36,7 +36,9 @@<br>
#include <valgrind.h><br>
#include <memcheck.h><br>
#define VG(x) x<br>
+#ifndef NDEBUG<br>
#define __gen_validate_value(x) VALGRIND_CHECK_MEM_IS_DEFINED(<wbr>&(x), sizeof(x))<br>
+#endif<br></blockquote><div><br></div><div>We could probably be fancier if we wanted to and disable all valgrind checks in release builds but this should take care of the hot-paths and leave us with at least something in release builds.</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
#else<br>
#define VG(x)<br>
#endif<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.17.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>