summaryrefslogtreecommitdiffstats
path: root/src/amd/common
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-04-10 17:16:51 +0200
committerSamuel Pitoiset <[email protected]>2019-04-12 17:30:55 +0200
commitfd4041987bf0390d1bf07ec77c8b2d89dac601c2 (patch)
treec61b2ea4b830fcb7859ce86776803eca45203e1d /src/amd/common
parent590a4c898191ba6af3b31caa8688536a5e19d2cf (diff)
ac: add ac_build_load_helper_invocation() helper
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r--src/amd/common/ac_llvm_build.c10
-rw-r--r--src/amd/common/ac_llvm_build.h3
-rw-r--r--src/amd/common/ac_nir_to_llvm.c13
3 files changed, 14 insertions, 12 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index d305af280d5..19496519165 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -4057,3 +4057,13 @@ ac_build_ddxy_interp(struct ac_llvm_context *ctx, LLVMValueRef interp_ij)
}
return ac_build_gather_values(ctx, result, 4);
}
+
+LLVMValueRef
+ac_build_load_helper_invocation(struct ac_llvm_context *ctx)
+{
+ LLVMValueRef result = ac_build_intrinsic(ctx, "llvm.amdgcn.ps.live",
+ ctx->i1, NULL, 0,
+ AC_FUNC_ATTR_READNONE);
+ result = LLVMBuildNot(ctx->builder, result, "");
+ return LLVMBuildSExt(ctx->builder, result, ctx->i32, "");
+}
diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h
index 64b6894538e..debc029f192 100644
--- a/src/amd/common/ac_llvm_build.h
+++ b/src/amd/common/ac_llvm_build.h
@@ -689,6 +689,9 @@ ac_build_frexp_mant(struct ac_llvm_context *ctx, LLVMValueRef src0,
LLVMValueRef
ac_build_ddxy_interp(struct ac_llvm_context *ctx, LLVMValueRef interp_ij);
+LLVMValueRef
+ac_build_load_helper_invocation(struct ac_llvm_context *ctx);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 1401998c666..90f7c66434d 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -2860,17 +2860,6 @@ static void emit_discard(struct ac_nir_context *ctx,
}
static LLVMValueRef
-visit_load_helper_invocation(struct ac_nir_context *ctx)
-{
- LLVMValueRef result = ac_build_intrinsic(&ctx->ac,
- "llvm.amdgcn.ps.live",
- ctx->ac.i1, NULL, 0,
- AC_FUNC_ATTR_READNONE);
- result = LLVMBuildNot(ctx->ac.builder, result, "");
- return LLVMBuildSExt(ctx->ac.builder, result, ctx->ac.i32, "");
-}
-
-static LLVMValueRef
visit_load_local_invocation_index(struct ac_nir_context *ctx)
{
LLVMValueRef result;
@@ -3283,7 +3272,7 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
result = ctx->abi->front_face;
break;
case nir_intrinsic_load_helper_invocation:
- result = visit_load_helper_invocation(ctx);
+ result = ac_build_load_helper_invocation(&ctx->ac);
break;
case nir_intrinsic_load_instance_id:
result = ctx->abi->instance_id;