From 7b0f05deeb56f041327ba6b251740ffe5c05425b Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 17 Nov 2020 12:02:27 -0500 Subject: [PATCH] [InstCombine] add vector test for mask of add; NFC --- test/Transforms/InstCombine/and.ll | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/Transforms/InstCombine/and.ll b/test/Transforms/InstCombine/and.ll index 554024eff9e..ec45b5183e7 100644 --- a/test/Transforms/InstCombine/and.ll +++ b/test/Transforms/InstCombine/and.ll @@ -1085,6 +1085,19 @@ define i8 @lowmask_add_2_uses(i8 %x) { ret i8 %r } +define <2 x i8> @lowmask_add_2_splat(<2 x i8> %x, <2 x i8>* %p) { +; CHECK-LABEL: @lowmask_add_2_splat( +; CHECK-NEXT: [[A:%.*]] = add <2 x i8> [[X:%.*]], +; CHECK-NEXT: store <2 x i8> [[A]], <2 x i8>* [[P:%.*]], align 2 +; CHECK-NEXT: [[R:%.*]] = and <2 x i8> [[A]], +; CHECK-NEXT: ret <2 x i8> [[R]] +; + %a = add <2 x i8> %x, ; 0xc0 + store <2 x i8> %a, <2 x i8>* %p + %r = and <2 x i8> %a, ; 0x3f + ret <2 x i8> %r +} + define i8 @not_lowmask_add(i8 %x) { ; CHECK-LABEL: @not_lowmask_add( ; CHECK-NEXT: [[A:%.*]] = add i8 [[X:%.*]], -64