[Mesa-dev] [PATCH v2 06/12] ac/nir: remove one useless check in visit_store_ssbo()

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Mar 13 10:50:14 UTC 2019


Trivial.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 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 c10a0cce16f..55d3ce90ce4 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1567,12 +1567,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;
-- 
2.21.0



More information about the mesa-dev mailing list