i965/fs: Drop the emit(fs_inst) overload.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 21 Feb 2014 23:23:42 +0000 (15:23 -0800)
committerMatt Turner <mattst88@gmail.com>
Sat, 22 Feb 2014 06:51:33 +0000 (22:51 -0800)
commit760c6777a0530b4894dec564cdf218f5364b4df1
tree60653a63ab875866553104482ac7a3e4808360f7
parent326fc60ee9457d17fb97a7f49c977743426b0859
i965/fs: Drop the emit(fs_inst) overload.

Using this emit function implicitly creates three copies, which
is pointlessly inefficient.

1. Code creates the original instruction.
2. Calling emit(fs_inst) copies it into the function.
3. It then allocates a new fs_inst and copies it into that.

The second could be eliminated by changing the signature to

   fs_inst(const fs_inst &)

but that wouldn't eliminate the third.  Making callers heap allocate the
instruction and call emit(fs_inst *) allows us to just use the original
one, with no extra copies, and isn't much more of a burden.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp