From 4dc55bcb308a32f343a27626c2d91bef735fc9dc Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Thu, 9 Feb 2017 21:33:19 +0000 Subject: [PATCH] [InstCombine] add test for demanded bits with splat vector constants; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294625 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 da71880b9bd..40f5cf27136 100644 --- a/test/Transforms/InstCombine/and.ll +++ b/test/Transforms/InstCombine/and.ll @@ -382,6 +382,19 @@ define i32 @test31(i1 %X) { ret i32 %A } +; FIXME: Demanded bit analysis allows us to eliminate the add. + +define <2 x i32> @and_demanded_bits_splat_vec(<2 x i32> %x) { +; CHECK-LABEL: @and_demanded_bits_splat_vec( +; CHECK-NEXT: [[Y:%.*]] = add <2 x i32> %x, +; CHECK-NEXT: [[Z:%.*]] = and <2 x i32> [[Y]], +; CHECK-NEXT: ret <2 x i32> [[Z]] +; + %y = add <2 x i32> %x, + %z = and <2 x i32> %y, + ret <2 x i32> %z +} + define i32 @test32(i32 %In) { ; CHECK-LABEL: @test32( ; CHECK-NEXT: ret i32 0 -- 2.40.0