[llvm] 566a667 - [InstSimplify] Add test for expand binop undef issue (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 13:40:12 PDT 2020


Author: Nikita Popov
Date: 2020-08-10T22:39:59+02:00
New Revision: 566a66703f020996d07191323ae8ad6f7ad827b3

URL: https://github.com/llvm/llvm-project/commit/566a66703f020996d07191323ae8ad6f7ad827b3
DIFF: https://github.com/llvm/llvm-project/commit/566a66703f020996d07191323ae8ad6f7ad827b3.diff

LOG: [InstSimplify] Add test for expand binop undef issue (NFC)

Add test case from https://reviews.llvm.org/D83360#2146539.

Added: 
    

Modified: 
    llvm/test/Transforms/InstSimplify/select.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstSimplify/select.ll b/llvm/test/Transforms/InstSimplify/select.ll
index b1264138a15e..49133ddcaa9b 100644
--- a/llvm/test/Transforms/InstSimplify/select.ll
+++ b/llvm/test/Transforms/InstSimplify/select.ll
@@ -919,3 +919,16 @@ define <2 x i32> @all_constant_true_undef_false_constexpr_vec() {
   %s = select i1 ptrtoint (<2 x i32> ()* @all_constant_true_undef_false_constexpr_vec to i1), <2 x i32> undef, <2 x i32><i32 -1, i32 ptrtoint (<2 x i32> ()* @all_constant_true_undef_false_constexpr_vec to i32)>
   ret <2 x i32> %s
 }
+
+define i1 @expand_binop_undef(i32 %x, i32 %y) {
+; CHECK-LABEL: @expand_binop_undef(
+; CHECK-NEXT:    [[CMP15:%.*]] = icmp slt i32 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT:    ret i1 [[CMP15]]
+;
+  %cmp9.not.1 = icmp eq i32 %x, %y
+  %cmp15 = icmp slt i32 %x, %y
+  %spec.select39 = select i1 %cmp9.not.1, i1 undef, i1 %cmp15
+  %spec.select40 = xor i1 %cmp9.not.1, 1
+  %spec.select  = and i1 %spec.select39, %spec.select40
+  ret i1 %spec.select
+}


        


More information about the llvm-commits mailing list