summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-02-09 21:33:19 +0000
committerSanjay Patel <spatel@rotateright.com>2017-02-09 21:33:19 +0000
commit5bcb2d97f0cf5bf315387da61376d9df4deab823 (patch)
tree4df1547e1d25c891819c83030028d27ab1fcb4a9 /llvm/test/Transforms
parent34fc95bb6f3769706a08eaca91eda24a378befba (diff)
downloadbcm5719-llvm-5bcb2d97f0cf5bf315387da61376d9df4deab823.tar.gz
bcm5719-llvm-5bcb2d97f0cf5bf315387da61376d9df4deab823.zip
[InstCombine] add test for demanded bits with splat vector constants; NFC
llvm-svn: 294625
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/and.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/and.ll b/llvm/test/Transforms/InstCombine/and.ll
index da71880b9bd..40f5cf27136 100644
--- a/llvm/test/Transforms/InstCombine/and.ll
+++ b/llvm/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, <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
OpenPOWER on IntegriCloud