[llvm-commits] [llvm] r75586 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/mul.ll

Nick Lewycky nlewycky at google.com
Mon Jul 13 19:25:12 PDT 2009


What if it's a vector of float? NAN * 0 != 0 which is what the comment was
alluding to with "finite".

2009/7/13 Eli Friedman <eli.friedman at gmail.com>

> Author: efriedma
> Date: Mon Jul 13 21:01:53 2009
> New Revision: 75586
>
> URL: http://llvm.org/viewvc/llvm-project?rev=75586&view=rev
> Log:
> Fix trivial todo in instcombine.
>
>
> Modified:
>    llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
>    llvm/trunk/test/Transforms/InstCombine/mul.ll
>
> Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=75586&r1=75585&r2=75586&view=diff
>
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Mon Jul 13
> 21:01:53 2009
> @@ -2702,7 +2702,8 @@
>                  Context->getConstantInt(Op0->getType(), Val.logBase2()));
>       }
>     } else if (isa<VectorType>(Op1->getType())) {
> -      // TODO: If Op1 is all zeros and Op0 is all finite, return all
> zeros.
> +      if (Op1->isNullValue())
> +        return ReplaceInstUsesWith(I, Op1);
>
>       if (ConstantVector *Op1V = dyn_cast<ConstantVector>(Op1)) {
>         if (Op1V->isAllOnesValue())              // X * -1 == 0 - X
>
> Modified: llvm/trunk/test/Transforms/InstCombine/mul.ll
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/mul.ll?rev=75586&r1=75585&r2=75586&view=diff
>
>
> ==============================================================================
> --- llvm/trunk/test/Transforms/InstCombine/mul.ll (original)
> +++ llvm/trunk/test/Transforms/InstCombine/mul.ll Mon Jul 13 21:01:53 2009
> @@ -83,3 +83,8 @@
>        store <4 x float> %3, <4 x float>* %0, align 1
>        ret void
>  }
> +
> +define <16 x i8> @test14(<16 x i8> %a) {
> +        %b = mul <16 x i8> %a, zeroinitializer
> +        ret <16 x i8> %b
> +}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090713/b8e2523c/attachment.html>


More information about the llvm-commits mailing list