ac/nir: drop nir_to_llvm_context from visit_load_local_invocation_index()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 9 Feb 2018 12:54:27 +0000 (13:54 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 12 Feb 2018 10:54:21 +0000 (11:54 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index 4ecbc985db1e16df802966b58c8616c4d2a73d83..c695d4ec721253bdf200a488e420707de1d6783d 100644 (file)
@@ -3899,14 +3899,14 @@ visit_load_helper_invocation(struct ac_nir_context *ctx)
 }
 
 static LLVMValueRef
-visit_load_local_invocation_index(struct nir_to_llvm_context *ctx)
+visit_load_local_invocation_index(struct ac_nir_context *ctx)
 {
        LLVMValueRef result;
        LLVMValueRef thread_id = ac_get_thread_id(&ctx->ac);
-       result = LLVMBuildAnd(ctx->builder, ctx->abi.tg_size,
+       result = LLVMBuildAnd(ctx->ac.builder, ctx->abi->tg_size,
                              LLVMConstInt(ctx->ac.i32, 0xfc0, false), "");
 
-       return LLVMBuildAdd(ctx->builder, result, thread_id, "");
+       return LLVMBuildAdd(ctx->ac.builder, result, thread_id, "");
 }
 
 static LLVMValueRef visit_var_atomic(struct nir_to_llvm_context *ctx,
@@ -4377,7 +4377,7 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
                result = ctx->abi->num_work_groups;
                break;
        case nir_intrinsic_load_local_invocation_index:
-               result = visit_load_local_invocation_index(ctx->nctx);
+               result = visit_load_local_invocation_index(ctx);
                break;
        case nir_intrinsic_load_push_constant:
                result = visit_load_push_constant(ctx->nctx, instr);