From: Sanjay Patel Date: Sat, 26 Nov 2016 16:13:23 +0000 (+0000) Subject: [InstCombine] add test to show missing vector optimization; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52894d83e1af04c9c222dd3405d3150c818894fd;p=llvm [InstCombine] add test to show missing vector optimization; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287982 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/exact.ll b/test/Transforms/InstCombine/exact.ll index 070dfd3c88e..436d5081c7a 100644 --- a/test/Transforms/InstCombine/exact.ll +++ b/test/Transforms/InstCombine/exact.ll @@ -88,19 +88,32 @@ define i32 @udiv2(i32 %x, i32 %w) { ret i32 %z } -define i64 @ashr1(i64 %X) nounwind { +define i64 @ashr1(i64 %X) { ; CHECK-LABEL: @ashr1( ; CHECK-NEXT: [[A:%.*]] = shl i64 %X, 8 ; CHECK-NEXT: [[B:%.*]] = ashr exact i64 [[A]], 2 ; CHECK-NEXT: ret i64 [[B]] ; %A = shl i64 %X, 8 - %B = ashr i64 %A, 2 ; X/4 + %B = ashr i64 %A, 2 ret i64 %B } +; FIXME: The ashr should be exact (like it is in the preceding test). + +define <2 x i64> @ashr1_vec(<2 x i64> %X) { +; CHECK-LABEL: @ashr1_vec( +; CHECK-NEXT: [[A:%.*]] = shl <2 x i64> %X, +; CHECK-NEXT: [[B:%.*]] = ashr <2 x i64> [[A]], +; CHECK-NEXT: ret <2 x i64> [[B]] +; + %A = shl <2 x i64> %X, + %B = ashr <2 x i64> %A, + ret <2 x i64> %B +} + ; PR9120 -define i1 @ashr_icmp1(i64 %X) nounwind { +define i1 @ashr_icmp1(i64 %X) { ; CHECK-LABEL: @ashr_icmp1( ; CHECK-NEXT: [[B:%.*]] = icmp eq i64 %X, 0 ; CHECK-NEXT: ret i1 [[B]]