From 81bc09bf97410cfc1b09d1f6471214d0c023e2fd Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Tue, 3 Oct 2023 11:12:47 -0700 Subject: [PATCH] intel/fs: Tweak default case of fs_inst::size_read() In the default case, there's a special case with a few conditions. Prefer the cheapest conditions first, so we can take advantage of short-circuiting. Effect is a small but still significant reduce in shader compilation times, as can be seen by: - Fossil replay for Rise of the Tomb Raider ``` Difference at 95.0% confidence -0.433333 +/- 0.028609 -1.42556% +/- 0.0941163% (Student's t, pooled s = 0.0337886) ``` - Fossil replay for Batman Arkham City ``` Difference at 95.0% confidence -8.84 +/- 0.146083 -1.65932% +/- 0.0274207% (Student's t, pooled s = 0.125423) ``` Reviewed-by: Kenneth Graunke Reviewed-by: Emma Anholt Part-of: --- src/intel/compiler/brw_fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 02d8f56..1fdf6f0 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -911,7 +911,7 @@ fs_inst::size_read(int arg) const break; default: - if (is_tex() && arg == 0 && src[0].file == VGRF) + if (arg == 0 && src[0].file == VGRF && is_tex()) return mlen * REG_SIZE; break; } -- 2.7.4