[Mesa-dev] [PATCH] i965: Trim
Matt Turner
mattst88 at gmail.com
Wed Feb 7 20:42:15 UTC 2018
On Wed, Feb 7, 2018 at 11:41 AM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> text data bss dec hex filename
> 8852169 388752 671064 9911985 973eb1 lib/i965_dri.so
> 8852017 388752 671064 9911833 973e19
> ---
> src/mesa/drivers/dri/i965/intel_tiled_memcpy.c | 48 +++++++++-----------------
> 1 file changed, 16 insertions(+), 32 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
> index 53a5679691..a8157b5232 100644
> --- a/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
> +++ b/src/mesa/drivers/dri/i965/intel_tiled_memcpy.c
> @@ -468,26 +468,22 @@ linear_to_xtiled_faster(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3,
> if (mem_copy == memcpy)
> return linear_to_xtiled(0, 0, xtile_width, xtile_width, 0, xtile_height,
> dst, src, src_pitch, swizzle_bit, memcpy, memcpy);
> - else if (mem_copy == rgba8_copy)
> + else /* if (mem_copy == rgba8_copy) */
> return linear_to_xtiled(0, 0, xtile_width, xtile_width, 0, xtile_height,
> dst, src, src_pitch, swizzle_bit,
> rgba8_copy, rgba8_copy_aligned_dst);
> - else
> - unreachable("not reached");
> } else {
> if (mem_copy == memcpy)
> return linear_to_xtiled(x0, x1, x2, x3, y0, y1,
> dst, src, src_pitch, swizzle_bit,
> memcpy, memcpy);
> - else if (mem_copy == rgba8_copy)
> + else /* if (mem_copy == rgba8_copy) */
> return linear_to_xtiled(x0, x1, x2, x3, y0, y1,
> dst, src, src_pitch, swizzle_bit,
> rgba8_copy, rgba8_copy_aligned_dst);
> - else
> - unreachable("not reached");
This should be a no-op. I'd expect the presence of 'else unreachable'
to allow the compiler to remove the previous conditional.
> }
> - linear_to_xtiled(x0, x1, x2, x3, y0, y1,
> - dst, src, src_pitch, swizzle_bit, mem_copy, mem_copy);
> +
> + unreachable("not reached");
I would expect this is what causes the change. If that's the case,
let's just make this change. What do you think?
More information about the mesa-dev
mailing list