[Mesa-dev] [PATCH 3/3] nir: Convert the builder to use the new NIR cursor API.
Kenneth Graunke
kenneth at whitecape.org
Thu Aug 6 16:11:47 PDT 2015
On Thursday, August 06, 2015 10:15:24 AM Kenneth Graunke wrote:
> -static inline void
> -nir_builder_insert_after_instr(nir_builder *build, nir_instr *after_instr)
> +nir_builder_instr_insert(nir_builder *build, nir_instr *instr)
> {
> - build->cf_node_list = NULL;
> - build->before_instr = NULL;
> - build->after_instr = after_instr;
> + switch (build->cursor.option) {
> + case nir_cursor_before_block:
> + nir_instr_insert_before_block(build->cursor.block, instr);
> + break;
> + case nir_cursor_after_block:
> + nir_instr_insert_after_block(build->cursor.block, instr);
> + break;
> + case nir_cursor_before_instr:
> + nir_instr_insert_before(build->cursor.instr, instr);
> + break;
> + case nir_cursor_after_instr:
> + nir_instr_insert_after(build->cursor.instr, instr);
> + break;
> + }
> }
>
> static inline void
> -nir_builder_instr_insert(nir_builder *build, nir_instr *instr)
> +nir_builder_cf_insert(nir_builder *build, nir_cf_node *cf)
> {
> - if (build->cf_node_list) {
> - nir_instr_insert_after_cf_list(build->cf_node_list, instr);
> - } else if (build->before_instr) {
> - nir_instr_insert_before(build->before_instr, instr);
> - } else {
> - assert(build->after_instr);
> - nir_instr_insert_after(build->after_instr, instr);
> - build->after_instr = instr;
> - }
> + nir_cf_node_insert(build->cursor, cf);
> }
NAK - this no longer moves the cursor after inserting an instruction,
making it pretty much useless. I'll fix and resend.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150806/6ce9b4d1/attachment.sig>
More information about the mesa-dev
mailing list