i965: Mark brw_hw_type_to_reg_type() as a pure function
authorMatt Turner <mattst88@gmail.com>
Thu, 3 Aug 2017 06:20:39 +0000 (23:20 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 21 Aug 2017 21:05:23 +0000 (14:05 -0700)
   text    data     bss     dec     hex filename
7816886  346248  420496 8583630  82f9ce i965_dri.so before
7816214  346248  420496 8582958  82f72e i965_dri.so after

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
src/intel/compiler/brw_reg_type.h

index 6fc57792b4b5e54674d64534b10258e97db5e5e0..87d9fe31e867f652f039f8c18b4a75472bf3422b 100644 (file)
 extern "C" {
 #endif
 
+#ifdef HAVE_FUNC_ATTRIBUTE_PURE
+#define ATTRIBUTE_PURE __attribute__((__pure__))
+#else
+#define ATTRIBUTE_PURE
+#endif
+
 enum brw_reg_file;
 struct gen_device_info;
 
@@ -63,7 +69,7 @@ unsigned
 brw_reg_type_to_hw_type(const struct gen_device_info *devinfo,
                         enum brw_reg_file file, enum brw_reg_type type);
 
-enum brw_reg_type
+enum brw_reg_type ATTRIBUTE_PURE
 brw_hw_type_to_reg_type(const struct gen_device_info *devinfo,
                         enum brw_reg_file file, unsigned hw_type);