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

Bruno Cardoso Lopes via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 10:25:51 PDT 2016


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


More information about the llvm-commits mailing list