[llvm] r294625 - [InstCombine] add test for demanded bits with splat vector constants; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 13:33:19 PST 2017
Author: spatel
Date: Thu Feb 9 15:33:19 2017
New Revision: 294625
URL: http://llvm.org/viewvc/llvm-project?rev=294625&view=rev
Log:
[InstCombine] add test for demanded bits with splat vector constants; NFC
Modified:
llvm/trunk/test/Transforms/InstCombine/and.ll
Modified: llvm/trunk/test/Transforms/InstCombine/and.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/and.ll?rev=294625&r1=294624&r2=294625&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/and.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/and.ll Thu Feb 9 15:33:19 2017
@@ -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, <i32 8, i32 8>
+; CHECK-NEXT: [[Z:%.*]] = and <2 x i32> [[Y]], <i32 7, i32 7>
+; CHECK-NEXT: ret <2 x i32> [[Z]]
+;
+ %y = add <2 x i32> %x, <i32 8, i32 8>
+ %z = and <2 x i32> %y, <i32 7, i32 7>
+ ret <2 x i32> %z
+}
+
define i32 @test32(i32 %In) {
; CHECK-LABEL: @test32(
; CHECK-NEXT: ret i32 0
More information about the llvm-commits
mailing list