[llvm-commits] [llvm] r128333 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp

Dan Gohman gohman at apple.com
Sat Mar 26 08:39:25 PDT 2011


On Mar 26, 2011, at 2:32 AM, Bill Wendling wrote:

> Author: void
> Date: Sat Mar 26 04:32:07 2011
> New Revision: 128333
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=128333&view=rev
> Log:
> Simplification noticed by Frits.
> 
> Modified:
>    llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
> 
> Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=128333&r1=128332&r2=128333&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Sat Mar 26 04:32:07 2011
> @@ -361,9 +361,8 @@
>   //
>   //        |--earlier--|
>   //    |-----  later  ------|
> -  if ((EarlierOff == LaterOff && Earlier.Size <= Later.Size) ||
> -      (EarlierOff > LaterOff &&
> -       EarlierOff + Earlier.Size <= LaterOff + Later.Size))
> +  if (EarlierOff >= LaterOff &&
> +      EarlierOff + Earlier.Size <= LaterOff + Later.Size)
>     return true;

I don't have time to fully investigate, but the testcase passes without the fix,
and the new code is now equivalent by De Morgan's law to the old code.

Dan




More information about the llvm-commits mailing list