On Fri, 11 Nov 2022 18:17:46 -0500 Andrew MacLeod <amacl...@redhat.com> wrote:
> On 11/11/22 16:56, Bernhard Reutner-Fischer wrote: > > So of course it doesn't really matter what that stmt was, a non_debug > > is as good as a debug one AFAIU, it's just a marker, as good as any SSA > > version or id, i suppose. So gsi_last_nondebug_bb(bb) is not strictly > > needed, fine. > It is important. It needs to be the last non-debug statement so that we Ah of course, debug stmts are skipped. What was i thinking :) > can properly feed values into the final stmt of the block.. be it a > conditional, switch or a return. Right, i see. Thanks! In my use-case, looking at blocks at the end of functions, i've seen asm, nop, label, phi and resx, in addition, i believe. > > But since it's last_stmt(), do you have an opinion on 1) in > > https://gcc.gnu.org/pipermail/gcc-help/2021-November/140908.html > > by chance, as you seem to use it.. > > Not really. It possible that there is a slightly more efficient way to > do it, not sure how measurable it would be. Patches always welcome :-) I don't think i measured it. But i think the output looked a tiny bit better than the current one. Well, thanks again for the explanation!