[llvm-commits] [llvm] r164814 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineSelect.cpp test/Transforms/InstCombine/vec_shuffle.ll
Duncan Sands
baldrick at free.fr
Fri Sep 28 09:04:33 PDT 2012
Hi Nick,
> Surprisingly, we missed a trivial case here. Fix that!
shouldn't this be in InstSimplify instead?
Ciao, Duncan.
>
> Modified:
> llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
> llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll
>
> Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=164814&r1=164813&r2=164814&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
> +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Fri Sep 28 04:33:53 2012
> @@ -930,6 +930,10 @@
> Value *V = Builder->CreateShuffleVector(TrueVal, FalseVal, MaskVal);
> return ReplaceInstUsesWith(SI, V);
> }
> +
> + if (isa<ConstantAggregateZero>(CondVal)) {
> + return ReplaceInstUsesWith(SI, FalseVal);
> + }
> }
>
> return 0;
>
> Modified: llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll?rev=164814&r1=164813&r2=164814&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll (original)
> +++ llvm/trunk/test/Transforms/InstCombine/vec_shuffle.ll Fri Sep 28 04:33:53 2012
> @@ -188,3 +188,11 @@
> <4 x i16> %lhs, <4 x i16> %rhs
> ret <4 x i16> %A
> }
> +
> +define <4 x i16> @test13e(<4 x i16> %lhs, <4 x i16> %rhs) {
> +; CHECK: @test13e
> +; CHECK-NEXT: ret <4 x i16> %rhs
> + %A = select <4 x i1> <i1 false, i1 false, i1 false, i1 false>,
> + <4 x i16> %lhs, <4 x i16> %rhs
> + ret <4 x i16> %A
> +}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list