From: Sanjay Patel Date: Fri, 6 Jan 2017 19:14:05 +0000 (+0000) Subject: [InstCombine] add a vector version of a test added in r291262; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e760878a957933a62bc37bf0d2476b651953526e;p=llvm [InstCombine] add a vector version of a test added in r291262; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291265 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/icmp-shl-nsw.ll b/test/Transforms/InstCombine/icmp-shl-nsw.ll index 85e397ec241..896a45625b9 100644 --- a/test/Transforms/InstCombine/icmp-shl-nsw.ll +++ b/test/Transforms/InstCombine/icmp-shl-nsw.ll @@ -201,5 +201,18 @@ define i1 @icmp_sgt11(i8 %x) { ret i1 %cmp } +; Splat vector version should fold the same way. + +define <2 x i1> @icmp_sgt11_vec(<2 x i8> %x) { +; CHECK-LABEL: @icmp_sgt11_vec( +; CHECK-NEXT: [[SHL:%.*]] = shl nsw <2 x i8> %x, +; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i8> [[SHL]], +; CHECK-NEXT: ret <2 x i1> [[CMP]] +; + %shl = shl nsw <2 x i8> %x, + %cmp = icmp sgt <2 x i8> %shl, + ret <2 x i1> %cmp +} + ; Known bits analysis returns false for compares with >=0.