ac/nir_to_llvm: add assert to emit_bcsel()
authorTimothy Arceri <tarceri@itsqueeze.com>
Sun, 17 Mar 2019 10:04:20 +0000 (21:04 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 17 Mar 2019 22:39:04 +0000 (09:39 +1100)
nir to llvm assumes we have already split vectors to scalars via
nir_lower_alu_to_scalar().

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index 18297ed99b16c6990d50bcfeae034d0fbd198b8d..0ca3f83a248b251725a856e09bb086cbeeb79bc1 100644 (file)
@@ -268,6 +268,8 @@ static LLVMValueRef emit_intrin_3f_param(struct ac_llvm_context *ctx,
 static LLVMValueRef emit_bcsel(struct ac_llvm_context *ctx,
                               LLVMValueRef src0, LLVMValueRef src1, LLVMValueRef src2)
 {
+       assert(LLVMGetTypeKind(LLVMTypeOf(src0)) != LLVMVectorTypeKind);
+
        LLVMValueRef v = LLVMBuildICmp(ctx->builder, LLVMIntNE, src0,
                                       ctx->i32_0, "");
        return LLVMBuildSelect(ctx->builder, v,