[llvm] r261525 - Fix for PR26690

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 08:07:30 PST 2016


On Mon, Feb 22, 2016 at 3:47 PM, Nemanja Ivanovic via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: nemanjai
> Date: Mon Feb 22 08:47:49 2016
> New Revision: 261525
>
> URL: http://llvm.org/viewvc/llvm-project?rev=261525&view=rev
> Log:
> Fix for PR26690
>
> I mistook BitVector::empty() to mean BitVector::count() == 0 and it does
> not. Corrected the issue with the fix for PR26500.
>
> Modified:
>     llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp
>
> Modified: llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp?rev=261525&r1=261524&r2=261525&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCFrameLowering.cpp Mon Feb 22 08:47:49 2016
> @@ -653,7 +653,7 @@ PPCFrameLowering::findScratchRegister(Ma
>
>    // Now that we've done our best to provide both registers, double check
>    // whether we were unable to provide enough.
> -  if (BV.empty() || (BV.count() < 2 && TwoUniqueRegsRequired))
> +  if (BV.count() < TwoUniqueRegsRequired ? 2 : 1)

This means (BV.count() < TwoUniqueRegsRequired) ? 2 : 1 which is
clearly not what you want. Also I STRONGLY recommend adding a test
case. How is this fixing anything?

>      return false;
>
>    return true;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list