From: Marek Olšák Date: Sat, 4 Jul 2020 20:49:52 +0000 (-0400) Subject: ac/llvm: fix bcsel for v2*16 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd69c59c43749020becab0f4c81c1e065858bc20;p=mesa.git ac/llvm: fix bcsel for v2*16 Reviewed-by: Bas Nieuwenhuizen Part-of: --- diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index b8ecd2765fb..735c48884e6 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -286,8 +286,6 @@ static LLVMValueRef emit_bcsel(struct ac_llvm_context *ctx, LLVMTypeRef src1_type = LLVMTypeOf(src1); LLVMTypeRef src2_type = LLVMTypeOf(src2); - assert(LLVMGetTypeKind(LLVMTypeOf(src0)) != LLVMVectorTypeKind); - if (LLVMGetTypeKind(src1_type) == LLVMPointerTypeKind && LLVMGetTypeKind(src2_type) != LLVMPointerTypeKind) { src2 = LLVMBuildIntToPtr(ctx->builder, src2, src1_type, ""); @@ -297,7 +295,7 @@ static LLVMValueRef emit_bcsel(struct ac_llvm_context *ctx, } LLVMValueRef v = LLVMBuildICmp(ctx->builder, LLVMIntNE, src0, - ctx->i32_0, ""); + LLVMConstNull(LLVMTypeOf(src0)), ""); return LLVMBuildSelect(ctx->builder, v, ac_to_integer_or_pointer(ctx, src1), ac_to_integer_or_pointer(ctx, src2), "");