Lines Matching defs:flow
46 /* Data for if/else/endif and bgnloop/endloop control flow structures.
130 ctx->flow = calloc(1, sizeof(*ctx->flow));
135 free(ctx->flow->stack);
136 free(ctx->flow);
137 ctx->flow = NULL;
2843 if (ctx->flow->depth > 0)
2844 return &ctx->flow->stack[ctx->flow->depth - 1];
2850 for (unsigned i = ctx->flow->depth; i > 0; --i) {
2851 if (ctx->flow->stack[i - 1].loop_entry_block)
2852 return &ctx->flow->stack[i - 1];
2859 struct ac_llvm_flow *flow;
2861 if (ctx->flow->depth >= ctx->flow->depth_max) {
2862 unsigned new_max = MAX2(ctx->flow->depth << 1, AC_LLVM_INITIAL_CF_DEPTH);
2864 ctx->flow->stack = realloc(ctx->flow->stack, new_max * sizeof(*ctx->flow->stack));
2865 ctx->flow->depth_max = new_max;
2868 flow = &ctx->flow->stack[ctx->flow->depth];
2869 ctx->flow->depth++;
2871 flow->next_block = NULL;
2872 flow->loop_entry_block = NULL;
2873 return flow;
2883 /* Append a basic block at the level of the parent flow.
2887 assert(ctx->flow->depth >= 1);
2889 if (ctx->flow->depth >= 2) {
2890 struct ac_llvm_flow *flow = &ctx->flow->stack[ctx->flow->depth - 2];
2892 return LLVMInsertBasicBlockInContext(ctx->context, flow->next_block, name);
2911 struct ac_llvm_flow *flow = push_flow(ctx);
2912 flow->loop_entry_block = append_basic_block(ctx, "LOOP");
2913 flow->next_block = append_basic_block(ctx, "ENDLOOP");
2914 set_basicblock_name(flow->loop_entry_block, "loop", label_id);
2915 LLVMBuildBr(ctx->builder, flow->loop_entry_block);
2916 LLVMPositionBuilderAtEnd(ctx->builder, flow->loop_entry_block);
2921 struct ac_llvm_flow *flow = get_innermost_loop(ctx);
2922 LLVMBuildBr(ctx->builder, flow->next_block);
2927 struct ac_llvm_flow *flow = get_innermost_loop(ctx);
2928 LLVMBuildBr(ctx->builder, flow->loop_entry_block);
2950 if (ctx->flow->depth == 0 && ctx->conditional_demote_seen) {
2973 ctx->flow->depth--;
2987 ctx->flow->depth--;
2993 struct ac_llvm_flow *flow = push_flow(ctx);
2997 flow->next_block = append_basic_block(ctx, "ELSE");
2999 LLVMBuildCondBr(ctx->builder, cond, if_block, flow->next_block);