<div dir="ltr">The reproducer was large and this was an existing bug.<div><br></div><div>I'll see if I can reduce the testcase by changing some flags, and if not, I'll commit it as is.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 6, 2016 at 10:25 AM, Bruno Cardoso Lopes <span dir="ltr"><<a href="mailto:bruno.cardoso@gmail.com" target="_blank">bruno.cardoso@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Kyle,<br>
<span class=""><br>
<br>
<br>
On Thu, Sep 1, 2016 at 6:20 PM, Kyle Butt via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: iteratee<br>
> Date: Thu Sep  1 20:20:06 2016<br>
> New Revision: 280448<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=280448&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=280448&view=rev</a><br>
> Log:<br>
> IfConversion: Don't count branches in # of duplicates.<br>
><br>
> If the entire blocks match, we would count the branch instructions<br>
> toward the number of duplicated instructions. This doesn't match what we<br>
> do elsewhere, and was causing a bug.<br>
<br>
</span>Testcase?<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Modified:<br>
>     llvm/trunk/lib/CodeGen/<wbr>IfConversion.cpp<br>
><br>
> Modified: llvm/trunk/lib/CodeGen/<wbr>IfConversion.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=280448&r1=280447&r2=280448&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/<wbr>CodeGen/IfConversion.cpp?rev=<wbr>280448&r1=280447&r2=280448&<wbr>view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- llvm/trunk/lib/CodeGen/<wbr>IfConversion.cpp (original)<br>
> +++ llvm/trunk/lib/CodeGen/<wbr>IfConversion.cpp Thu Sep  1 20:20:06 2016<br>
> @@ -671,7 +671,9 @@ bool IfConverter::<wbr>CountDuplicatedInstruc<br>
>      std::vector<MachineOperand> PredDefs;<br>
>      if (TII->DefinesPredicate(*TIB, PredDefs))<br>
>        return false;<br>
> -    ++Dups1;<br>
> +    // If we get all the way to the branch instructions, don't count them.<br>
> +    if (!TIB->isBranch())<br>
> +      ++Dups1;<br>
>      ++TIB;<br>
>      ++FIB;<br>
>    }<br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Bruno Cardoso Lopes<br>
<a href="http://www.brunocardoso.cc" rel="noreferrer" target="_blank">http://www.brunocardoso.cc</a><br>
</font></span></blockquote></div><br></div>