ac/nir: set the second v_cvt_pkrtz argument to undef if it's unused
authorMarek Olšák <marek.olsak@amd.com>
Mon, 11 May 2020 20:31:58 +0000 (16:31 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 2 Jun 2020 20:29:25 +0000 (16:29 -0400)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5003>

src/amd/llvm/ac_nir_to_llvm.c

index 8a707c93666becfeb71505de5be66faf1e60e9ce..cfdba201d4d421f4ba905e22897479e6100a56b0 100644 (file)
@@ -971,7 +971,7 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
                        }
 
                        assert(ac_get_llvm_num_components(src[0]) == 1);
-                       LLVMValueRef param[2] = { src[0], ctx->ac.f32_0 };
+                       LLVMValueRef param[2] = { src[0], LLVMGetUndef(ctx->ac.f32) };
                        result = ac_build_cvt_pkrtz_f16(&ctx->ac, param);
                        result = LLVMBuildExtractElement(ctx->ac.builder, result, ctx->ac.i32_0, "");
                } else {