[llvm] 33901ac - [InstCombine] add test for icmp with zext-bool logic; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 13:35:12 PDT 2022


Author: Sanjay Patel
Date: 2022-07-29T16:35:04-04:00
New Revision: 33901acd4a8be4fc7a466cf781e95407805179f2

URL: https://github.com/llvm/llvm-project/commit/33901acd4a8be4fc7a466cf781e95407805179f2
DIFF: https://github.com/llvm/llvm-project/commit/33901acd4a8be4fc7a466cf781e95407805179f2.diff

LOG: [InstCombine] add test for icmp with zext-bool logic; NFC

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/icmp.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll
index 35c85b7072be4..5928e11a5a2d9 100644
--- a/llvm/test/Transforms/InstCombine/icmp.ll
+++ b/llvm/test/Transforms/InstCombine/icmp.ll
@@ -4167,6 +4167,19 @@ define i1 @zext_bool_and_ne1(i1 %x, i8 %y) {
   ret i1 %r
 }
 
+define <2 x i1> @zext_bool_and_eq1(<2 x i1> %x, <2 x i8> %y) {
+; CHECK-LABEL: @zext_bool_and_eq1(
+; CHECK-NEXT:    [[ZX:%.*]] = zext <2 x i1> [[X:%.*]] to <2 x i8>
+; CHECK-NEXT:    [[A:%.*]] = and <2 x i8> [[ZX]], [[Y:%.*]]
+; CHECK-NEXT:    [[R:%.*]] = icmp eq <2 x i8> [[A]], <i8 1, i8 1>
+; CHECK-NEXT:    ret <2 x i1> [[R]]
+;
+  %zx = zext <2 x i1> %x to <2 x i8>
+  %a = and <2 x i8> %zx, %y
+  %r = icmp eq <2 x i8> %a, <i8 1, i8 1>
+  ret <2 x i1> %r
+}
+
 ; negative test - wrong logic op
 
 define i1 @zext_bool_or_eq0(i1 %x, i8 %y) {


        


More information about the llvm-commits mailing list