From 2b9ed257c0c4db879970afb2c5981c59ca70c21b Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sat, 13 Apr 2013 16:36:02 +0200 Subject: r600g/llvm: Use gprcount from llvm --- src/gallium/drivers/r600/r600_llvm.c | 2 ++ src/gallium/drivers/r600/r600_llvm.h | 1 + src/gallium/drivers/r600/r600_shader.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/r600') diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c index e605e6bec4c..35d6c9015d7 100644 --- a/src/gallium/drivers/r600/r600_llvm.c +++ b/src/gallium/drivers/r600/r600_llvm.c @@ -555,6 +555,7 @@ unsigned r600_llvm_compile( unsigned char ** inst_bytes, unsigned * inst_byte_count, enum radeon_family family, + unsigned *ngpr, unsigned dump) { unsigned r; @@ -563,6 +564,7 @@ unsigned r600_llvm_compile( r = radeon_llvm_compile(mod, &binary, gpu_family, dump); *inst_bytes = binary.code; *inst_byte_count = binary.code_size; + *ngpr = util_le32_to_cpu(*(uint32_t*)binary.config); return r; } diff --git a/src/gallium/drivers/r600/r600_llvm.h b/src/gallium/drivers/r600/r600_llvm.h index b5e2af2afed..afc6881d67e 100644 --- a/src/gallium/drivers/r600/r600_llvm.h +++ b/src/gallium/drivers/r600/r600_llvm.h @@ -20,6 +20,7 @@ unsigned r600_llvm_compile( unsigned char ** inst_bytes, unsigned * inst_byte_count, enum radeon_family family, + unsigned *ngpr, unsigned dump); #endif /* defined R600_USE_LLVM || defined HAVE_OPENCL */ diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 5ac8c095183..465186d8a49 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -1461,7 +1461,7 @@ static int r600_shader_from_tgsi(struct r600_screen *rscreen, mod = r600_tgsi_llvm(&radeon_llvm_ctx, tokens); if (r600_llvm_compile(mod, &inst_bytes, &inst_byte_count, - rscreen->family, dump)) { + rscreen->family, &ctx.bc->ngpr, dump)) { FREE(inst_bytes); radeon_llvm_dispose(&radeon_llvm_ctx); use_llvm = 0; -- cgit v1.2.3