From: Sanjay Patel Date: Thu, 27 Oct 2016 20:51:03 +0000 (+0000) Subject: [InstCombine] add vector tests for foldSPFofSPF to show missing folds X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=923f74b27c1565e009fd9cc16f85e385003a8b5e;p=platform%2Fupstream%2Fllvm.git [InstCombine] add vector tests for foldSPFofSPF to show missing folds llvm-svn: 285340 --- diff --git a/llvm/test/Transforms/InstCombine/select.ll b/llvm/test/Transforms/InstCombine/select.ll index 518575f..3f811b6 100644 --- a/llvm/test/Transforms/InstCombine/select.ll +++ b/llvm/test/Transforms/InstCombine/select.ll @@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s ; PR1822 @@ -1299,6 +1300,22 @@ define i32 @test68(i32 %x) { ret i32 %retval } +; FIXME - vector neglect +define <2 x i32> @test68vec(<2 x i32> %x) { +; CHECK-LABEL: @test68vec( +; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i32> %x, +; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i32> , <2 x i32> %x +; CHECK-NEXT: [[CMP3:%.*]] = icmp sgt <2 x i32> [[COND]], +; CHECK-NEXT: [[RETVAL:%.*]] = select <2 x i1> [[CMP3]], <2 x i32> , <2 x i32> [[COND]] +; CHECK-NEXT: ret <2 x i32> [[RETVAL]] +; + %cmp = icmp slt <2 x i32> , %x + %cond = select <2 x i1> %cmp, <2 x i32> , <2 x i32> %x + %cmp3 = icmp slt <2 x i32> , %cond + %retval = select <2 x i1> %cmp3, <2 x i32> , <2 x i32> %cond + ret <2 x i32> %retval +} + ; MIN(MIN(X, 24), 83) -> MIN(X, 24) define i32 @test69(i32 %x) { ; CHECK-LABEL: @test69( @@ -1355,6 +1372,22 @@ define i32 @test72(i32 %x) { ret i32 %retval } +; FIXME - vector neglect +define <2 x i32> @test72vec(<2 x i32> %x) { +; CHECK-LABEL: @test72vec( +; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i32> %x, +; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i32> , <2 x i32> %x +; CHECK-NEXT: [[CMP3:%.*]] = icmp sgt <2 x i32> [[COND]], +; CHECK-NEXT: [[RETVAL:%.*]] = select <2 x i1> [[CMP3]], <2 x i32> , <2 x i32> [[COND]] +; CHECK-NEXT: ret <2 x i32> [[RETVAL]] +; + %cmp = icmp sgt <2 x i32> %x, + %cond = select <2 x i1> %cmp, <2 x i32> , <2 x i32> %x + %cmp3 = icmp sgt <2 x i32> %cond, + %retval = select <2 x i1> %cmp3, <2 x i32> , <2 x i32> %cond + ret <2 x i32> %retval +} + ; MIN(MIN(X, 83), 24) -> MIN(X, 24) define i32 @test73(i32 %x) { ; CHECK-LABEL: @test73(