[llvm] r280448 - IfConversion: Don't count branches in # of duplicates.

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 10:49:16 PDT 2016


The reproducer was large and this was an existing bug.

I'll see if I can reduce the testcase by changing some flags, and if not,
I'll commit it as is.

On Tue, Sep 6, 2016 at 10:25 AM, Bruno Cardoso Lopes <
bruno.cardoso at gmail.com> wrote:

> Hi Kyle,
>
>
>
> On Thu, Sep 1, 2016 at 6:20 PM, Kyle Butt via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> > Author: iteratee
> > Date: Thu Sep  1 20:20:06 2016
> > New Revision: 280448
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=280448&view=rev
> > Log:
> > IfConversion: Don't count branches in # of duplicates.
> >
> > If the entire blocks match, we would count the branch instructions
> > toward the number of duplicated instructions. This doesn't match what we
> > do elsewhere, and was causing a bug.
>
> Testcase?
>
> >
> > Modified:
> >     llvm/trunk/lib/CodeGen/IfConversion.cpp
> >
> > Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp
> > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> CodeGen/IfConversion.cpp?rev=280448&r1=280447&r2=280448&view=diff
> > ============================================================
> ==================
> > --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Thu Sep  1 20:20:06 2016
> > @@ -671,7 +671,9 @@ bool IfConverter::CountDuplicatedInstruc
> >      std::vector<MachineOperand> PredDefs;
> >      if (TII->DefinesPredicate(*TIB, PredDefs))
> >        return false;
> > -    ++Dups1;
> > +    // If we get all the way to the branch instructions, don't count
> them.
> > +    if (!TIB->isBranch())
> > +      ++Dups1;
> >      ++TIB;
> >      ++FIB;
> >    }
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
>
> --
> Bruno Cardoso Lopes
> http://www.brunocardoso.cc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160906/fd4afc9e/attachment.html>


More information about the llvm-commits mailing list