From: Philip Reames Date: Wed, 21 Aug 2019 16:57:53 +0000 (+0000) Subject: Add a couple of extra test noticed in post-commit discussion of rL369541 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ce104406f2050e98200596ce907af6190e22b2a;p=llvm Add a couple of extra test noticed in post-commit discussion of rL369541 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369546 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/icmp-sub.ll b/test/Transforms/InstCombine/icmp-sub.ll index 3e7cb4edc1d..0486263ff53 100644 --- a/test/Transforms/InstCombine/icmp-sub.ll +++ b/test/Transforms/InstCombine/icmp-sub.ll @@ -124,3 +124,22 @@ define i1 @test_sub_127_Y_eq_127(i8 %y) { %z = icmp eq i8 %s, 127 ret i1 %z } + +define i1 @test_sub_255_Y_eq_255(i8 %y) { +; CHECK-LABEL: @test_sub_255_Y_eq_255( +; CHECK-NEXT: [[Z:%.*]] = icmp eq i8 [[Y:%.*]], 0 +; CHECK-NEXT: ret i1 [[Z]] +; + %s = sub i8 255, %y + %z = icmp eq i8 %s, 255 + ret i1 %z +} +define <2 x i1> @test_sub_255_Y_eq_255_vec(<2 x i8> %y) { +; CHECK-LABEL: @test_sub_255_Y_eq_255_vec( +; CHECK-NEXT: [[Z:%.*]] = icmp eq <2 x i8> [[Y:%.*]], zeroinitializer +; CHECK-NEXT: ret <2 x i1> [[Z]] +; + %s = sub <2 x i8> , %y + %z = icmp eq <2 x i8> %s, + ret <2 x i1> %z +}