[llvm] r275990 - add missing test for simplifySelectBitTest()
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 19 09:49:58 PDT 2016
Author: spatel
Date: Tue Jul 19 11:49:55 2016
New Revision: 275990
URL: http://llvm.org/viewvc/llvm-project?rev=275990&view=rev
Log:
add missing test for simplifySelectBitTest()
Modified:
llvm/trunk/test/Transforms/InstSimplify/select.ll
Modified: llvm/trunk/test/Transforms/InstSimplify/select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/select.ll?rev=275990&r1=275989&r2=275990&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/select.ll (original)
+++ llvm/trunk/test/Transforms/InstSimplify/select.ll Tue Jul 19 11:49:55 2016
@@ -131,6 +131,20 @@ define i32 @select_icmp_and_8_eq_0_or_8(
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
More information about the llvm-commits
mailing list