summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-07-19 16:49:55 +0000
committerSanjay Patel <spatel@rotateright.com>2016-07-19 16:49:55 +0000
commitd2ff6d727f8761d9179a043583f0b76422acfef6 (patch)
tree02306bd50244423ddc84497024f690664f9282b3
parent1c382622791d28b552d5e7329319eff566b4a75d (diff)
downloadbcm5719-llvm-d2ff6d727f8761d9179a043583f0b76422acfef6.tar.gz
bcm5719-llvm-d2ff6d727f8761d9179a043583f0b76422acfef6.zip
add missing test for simplifySelectBitTest()
llvm-svn: 275990
-rw-r--r--llvm/test/Transforms/InstSimplify/select.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/select.ll b/llvm/test/Transforms/InstSimplify/select.ll
index a449b38d02d..2f19d841f8c 100644
--- a/llvm/test/Transforms/InstSimplify/select.ll
+++ b/llvm/test/Transforms/InstSimplify/select.ll
@@ -131,6 +131,20 @@ define i32 @select_icmp_and_8_eq_0_or_8(i32 %x) {
ret i32 %or.x
}
+; PR28466: https://llvm.org/bugs/show_bug.cgi?id=28466
+; InstSimplify needs to recognize variations of this pattern.
+
+define i32 @select_icmp_and_8_ne_0_or_128(i32 %x) {
+; CHECK-LABEL: @select_icmp_and_8_ne_0_or_128(
+; CHECK-NEXT: ret i32 %x
+;
+ %and = and i32 %x, 128
+ %cmp = icmp eq i32 %and, 0
+ %or = or i32 %x, 128
+ %or.x = select i1 %cmp, i32 %x, i32 %or
+ ret i32 %or.x
+}
+
define i32 @select_icmp_and_8_ne_0_and_not_8(i32 %x) {
; CHECK-LABEL: @select_icmp_and_8_ne_0_and_not_8(
; CHECK-NEXT: [[AND1:%.*]] = and i32 %x, -9
OpenPOWER on IntegriCloud