<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 30, 2017 at 4:21 PM, Davide Italiano via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank" class="cremed">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davide added a comment.<br>
<br>
This actually seem to happen, i.e. we hit this assertion. We have an end-to-end (i.e. C test) that reduces to:<br>
<br>
  define void @patatino() {<br>
  for.cond:<br>
    br label %for.body<br>
<br>
  for.body:<br>
    %tobool = icmp eq i32 5, 0<br>
    %sel = select i1 %tobool, i32 0, i32 2<br>
    br i1 undef, label %cleanup1.thread, label %cleanup1<br>
<br>
  cleanup1.thread:<br>
    ret void<br>
<br>
  cleanup1:<br>
    %cleanup.dest2 = phi i32 [ %sel, %for.body ]<br>
    %switch = icmp ult i32 %cleanup.dest2, 1<br>
    ret void<br>
  }<br>
<br>
  define void @main() {<br>
  entry:<br>
    call void @patatino()<br>
    ret void<br>
  }<br>
<br>
crashing with `opt -inline` as when we call `SimplifyInstruction`<br>
<br>
  %switch = icmp ult i32 %cleanup.dest2, 1<br>
<br>
simplifies to<br>
<br>
  %tobool = icmp eq i32 5, 0<br>
<br>
This simplification, if something, is a little peculiar, as I expected that to just be simplified to `false`.<br></blockquote><div><br></div><div>But the assert is that it should simplify to the copy of that instruction that has already been inserted into main, and not to the copy remaining in patatino.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D33850" rel="noreferrer" target="_blank" class="cremed">https://reviews.llvm.org/<wbr>D33850</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>