Mesa (master): ac/nir: remove one useless check in visit_store_ssbo()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Mar 20 21:19:15 UTC 2019


Module: Mesa
Branch: master
Commit: b39844457fd1fcbdcab6960bba32d083672e1f2c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b39844457fd1fcbdcab6960bba32d083672e1f2c

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Tue Mar 12 10:29:22 2019 +0100

ac/nir: remove one useless check in visit_store_ssbo()

Trivial.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/common/ac_nir_to_llvm.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index e3728a9c381..e0ca6a5a548 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1569,12 +1569,9 @@ static void visit_store_ssbo(struct ac_nir_context *ctx,
 		}
 		data = extract_vector_range(&ctx->ac, base_data, start, count);
 
-		if (start == 0) {
-			offset = base_offset;
-		} else {
-			offset = LLVMBuildAdd(ctx->ac.builder, base_offset,
-					      LLVMConstInt(ctx->ac.i32, start * elem_size_bytes, false), "");
-		}
+		offset = LLVMBuildAdd(ctx->ac.builder, base_offset,
+				      LLVMConstInt(ctx->ac.i32, start * elem_size_bytes, false), "");
+
 		if (num_bytes == 2) {
 			store_name = "llvm.amdgcn.tbuffer.store.i32";
 			data_type = ctx->ac.i32;




More information about the mesa-commit mailing list