summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-09-29 11:17:03 +0200
committerNicolai Hähnle <[email protected]>2017-10-02 12:17:15 +0200
commit052b974fed3586f3b2f61d2d2c050c1807ec43c5 (patch)
treefb00c49401d760684f80a7032ca6ef2e21698900 /src/gallium
parent70f6b95862a5b71d6e13fbab1c05763808c390a3 (diff)
amd/common: move ac_build_phi from radeonsi
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index d012c19a58a..c11a4ebeade 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -234,20 +234,6 @@ unsigned si_shader_io_get_unique_index(unsigned semantic_name, unsigned index)
}
/**
- * Helper function that builds an LLVM IR PHI node and immediately adds
- * incoming edges.
- */
-static LLVMValueRef
-build_phi(struct ac_llvm_context *ctx, LLVMTypeRef type,
- unsigned count_incoming, LLVMValueRef *values,
- LLVMBasicBlockRef *blocks)
-{
- LLVMValueRef phi = LLVMBuildPhi(ctx->builder, type, "");
- LLVMAddIncoming(phi, values, blocks, count_incoming);
- return phi;
-}
-
-/**
* Get the value of a shader input parameter and extract a bitfield.
*/
static LLVMValueRef unpack_param(struct si_shader_context *ctx,
@@ -2922,15 +2908,15 @@ static void si_llvm_emit_tcs_epilogue(struct lp_build_tgsi_context *bld_base)
values[0] = rel_patch_id;
values[1] = LLVMGetUndef(ctx->i32);
- rel_patch_id = build_phi(&ctx->ac, ctx->i32, 2, values, blocks);
+ rel_patch_id = ac_build_phi(&ctx->ac, ctx->i32, 2, values, blocks);
values[0] = tf_lds_offset;
values[1] = LLVMGetUndef(ctx->i32);
- tf_lds_offset = build_phi(&ctx->ac, ctx->i32, 2, values, blocks);
+ tf_lds_offset = ac_build_phi(&ctx->ac, ctx->i32, 2, values, blocks);
values[0] = invocation_id;
values[1] = ctx->i32_1; /* cause the epilog to skip threads */
- invocation_id = build_phi(&ctx->ac, ctx->i32, 2, values, blocks);
+ invocation_id = ac_build_phi(&ctx->ac, ctx->i32, 2, values, blocks);
}
/* Return epilog parameters from this function. */