ac: add ac_build_readlane without optimization barrier
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
This commit is contained in:
@@ -3595,8 +3595,6 @@ _ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef l
|
|||||||
LLVMTypeRef type = LLVMTypeOf(src);
|
LLVMTypeRef type = LLVMTypeOf(src);
|
||||||
LLVMValueRef result;
|
LLVMValueRef result;
|
||||||
|
|
||||||
ac_build_optimization_barrier(ctx, &src);
|
|
||||||
|
|
||||||
src = LLVMBuildZExt(ctx->builder, src, ctx->i32, "");
|
src = LLVMBuildZExt(ctx->builder, src, ctx->i32, "");
|
||||||
if (lane)
|
if (lane)
|
||||||
lane = LLVMBuildZExt(ctx->builder, lane, ctx->i32, "");
|
lane = LLVMBuildZExt(ctx->builder, lane, ctx->i32, "");
|
||||||
@@ -3613,13 +3611,17 @@ _ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef l
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the "llvm.amdgcn.readlane" or "llvm.amdgcn.readfirstlane" intrinsic.
|
* Builds the "llvm.amdgcn.readlane" or "llvm.amdgcn.readfirstlane" intrinsic.
|
||||||
|
*
|
||||||
|
* The optimization barrier is not needed if the value is the same in all lanes
|
||||||
|
* or if this is called in the outermost block.
|
||||||
|
*
|
||||||
* @param ctx
|
* @param ctx
|
||||||
* @param src
|
* @param src
|
||||||
* @param lane - id of the lane or NULL for the first active lane
|
* @param lane - id of the lane or NULL for the first active lane
|
||||||
* @return value of the lane
|
* @return value of the lane
|
||||||
*/
|
*/
|
||||||
LLVMValueRef
|
LLVMValueRef ac_build_readlane_no_opt_barrier(struct ac_llvm_context *ctx,
|
||||||
ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef lane)
|
LLVMValueRef src, LLVMValueRef lane)
|
||||||
{
|
{
|
||||||
LLVMTypeRef src_type = LLVMTypeOf(src);
|
LLVMTypeRef src_type = LLVMTypeOf(src);
|
||||||
src = ac_to_integer(ctx, src);
|
src = ac_to_integer(ctx, src);
|
||||||
@@ -3648,6 +3650,14 @@ ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef la
|
|||||||
return LLVMBuildBitCast(ctx->builder, ret, src_type, "");
|
return LLVMBuildBitCast(ctx->builder, ret, src_type, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLVMValueRef
|
||||||
|
ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef lane)
|
||||||
|
{
|
||||||
|
ac_build_optimization_barrier(ctx, &src);
|
||||||
|
|
||||||
|
return ac_build_readlane_no_opt_barrier(ctx, src, lane);
|
||||||
|
}
|
||||||
|
|
||||||
LLVMValueRef
|
LLVMValueRef
|
||||||
ac_build_writelane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef value, LLVMValueRef lane)
|
ac_build_writelane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef value, LLVMValueRef lane)
|
||||||
{
|
{
|
||||||
|
@@ -655,6 +655,9 @@ void ac_apply_fmask_to_sample(struct ac_llvm_context *ac, LLVMValueRef fmask,
|
|||||||
LLVMValueRef
|
LLVMValueRef
|
||||||
ac_build_ds_swizzle(struct ac_llvm_context *ctx, LLVMValueRef src, unsigned mask);
|
ac_build_ds_swizzle(struct ac_llvm_context *ctx, LLVMValueRef src, unsigned mask);
|
||||||
|
|
||||||
|
LLVMValueRef ac_build_readlane_no_opt_barrier(struct ac_llvm_context *ctx,
|
||||||
|
LLVMValueRef src, LLVMValueRef lane);
|
||||||
|
|
||||||
LLVMValueRef
|
LLVMValueRef
|
||||||
ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef lane);
|
ac_build_readlane(struct ac_llvm_context *ctx, LLVMValueRef src, LLVMValueRef lane);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user