<div dir="ltr">Holy crap, I completely missed that. I'm sorry! That's my fault.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 2, 2020 at 12:15 PM Johannes Doerfert <<a href="mailto:jdoerfert@anl.gov">jdoerfert@anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 01/30, Karl Rehm via llvm-dev wrote:<br>
> Since the bug report here: <a href="https://bugs.llvm.org/show_bug.cgi?id=44679" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug.cgi?id=44679</a> I've<br>
> been thinking about cases like it, such as: <a href="https://godbolt.org/z/Fwq8mn" rel="noreferrer" target="_blank">https://godbolt.org/z/Fwq8mn</a><br>
> <br>
> I wonder what we can do about this in a general sense. As far as I can<br>
> tell, the jump threading algorithm is *really* conservative, which is one<br>
> reason this isn't working as well as I'd hope; however, we don't want to<br>
> produce irreducible control flow that the other passes would work less<br>
> effectively on. Thoughts?<br>
<br>
I'm confused. In your godbold link you run it with O0 which disables<br>
almost all transformations. If we take the IR, remove the optnone<br>
attribute, run mem2reg and jump-threading we get what I think is<br>
reasonable:<br>
  <a href="https://godbolt.org/z/u3fcTZ" rel="noreferrer" target="_blank">https://godbolt.org/z/u3fcTZ</a><br>
<br>
Please correct me if I misunderstand anything here.<br>
<br>
Cheers,<br>
  Johannes<br>
</blockquote></div>