i965/vec4: Pass const references to vec4_instruction().
authorMatt Turner <mattst88@gmail.com>
Sat, 28 Jun 2014 20:46:29 +0000 (13:46 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 1 Jul 2014 05:31:05 +0000 (22:31 -0700)
   text    data     bss     dec     hex filename
4244821  123200   39648 4407669  434175 i965_dri.so
4231165  123200   39648 4394013  430c1d i965_dri.so

Cuts 13k of .text and saves a bunch of useless struct copies.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index 366198c115fa8f1dce2fb9f0c58030e972b7bf86..5702d06cbd2bfbc779b705746c92a984a0605d8c 100644 (file)
@@ -233,10 +233,10 @@ public:
    DECLARE_RALLOC_CXX_OPERATORS(vec4_instruction)
 
    vec4_instruction(vec4_visitor *v, enum opcode opcode,
-                   dst_reg dst = dst_reg(),
-                   src_reg src0 = src_reg(),
-                   src_reg src1 = src_reg(),
-                   src_reg src2 = src_reg());
+                    const dst_reg &dst = dst_reg(),
+                    const src_reg &src0 = src_reg(),
+                    const src_reg &src1 = src_reg(),
+                    const src_reg &src2 = src_reg());
 
    struct brw_reg get_dst(void);
    struct brw_reg get_src(const struct brw_vec4_prog_data *prog_data, int i);
index 3a360d452d2e84f5ed18d57e9182bcce4fcb731b..c732c90068c632347d2e5f4ace5249fa51e08bc9 100644 (file)
@@ -30,8 +30,9 @@ extern "C" {
 namespace brw {
 
 vec4_instruction::vec4_instruction(vec4_visitor *v,
-                                  enum opcode opcode, dst_reg dst,
-                                  src_reg src0, src_reg src1, src_reg src2)
+                                   enum opcode opcode, const dst_reg &dst,
+                                   const src_reg &src0, const src_reg &src1,
+                                   const src_reg &src2)
 {
    this->opcode = opcode;
    this->dst = dst;