[Mesa-dev] [PATCH 2/2] radeonsi: fix build of si_eliminate_const_vs_outputs on LLVM <= 3.8

Nicolai Hähnle nhaehnle at gmail.com
Thu Oct 20 08:39:00 UTC 2016


For the series:

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

On 20.10.2016 00:14, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> ---
>  src/gallium/drivers/radeonsi/si_shader.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index a810d9a..30e45cc 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -6602,24 +6602,23 @@ static void si_eliminate_const_vs_outputs(struct si_shader_context *ctx)
>  	while (bb) {
>  		LLVMValueRef inst = LLVMGetFirstInstruction(bb);
>
>  		while (inst) {
>  			LLVMValueRef cur = inst;
>  			inst = LLVMGetNextInstruction(inst);
>
>  			if (LLVMGetInstructionOpcode(cur) != LLVMCall)
>  				continue;
>
> -			LLVMValueRef callee = LLVMGetCalledValue(cur);
> -			LLVMValueKind kind = LLVMGetValueKind(callee);
> +			LLVMValueRef callee = lp_get_called_value(cur);
>
> -			if (kind != LLVMFunctionValueKind)
> +			if (!lp_is_function(callee))
>  				continue;
>
>  			const char *name = LLVMGetValueName(callee);
>  			unsigned num_args = LLVMCountParams(callee);
>
>  			/* Check if this is an export instruction. */
>  			if (num_args != 9 || strcmp(name, "llvm.SI.export"))
>  				continue;
>
>  			LLVMValueRef arg = LLVMGetOperand(cur, 3);
>


More information about the mesa-dev mailing list