[llvm] fe52925 - [InstCombine] add tests for icmp predicate canonicalization with vector types; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 07:07:32 PDT 2019


Author: Sanjay Patel
Date: 2019-10-29T10:07:23-04:00
New Revision: fe5292545f768592fa1d8881c3b8c1bca43f8dfb

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

LOG: [InstCombine] add tests for icmp predicate canonicalization with vector types; NFC

Increase coverage for D69519.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/icmp-vec.ll b/llvm/test/Transforms/InstCombine/icmp-vec.ll
index cb83db5f8fa7..da80450ca9dc 100644
--- a/llvm/test/Transforms/InstCombine/icmp-vec.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-vec.ll
@@ -179,13 +179,22 @@ define <2 x i1> @PR27756_1(<2 x i8> %a) {
 
 ; Undef elements don't prevent the transform of the comparison.
 
-define <2 x i1> @PR27756_2(<2 x i8> %a) {
+define <3 x i1> @PR27756_2(<3 x i8> %a) {
 ; CHECK-LABEL: @PR27756_2(
-; CHECK-NEXT:    [[CMP:%.*]] = icmp slt <2 x i8> [[A:%.*]], <i8 undef, i8 1>
-; CHECK-NEXT:    ret <2 x i1> [[CMP]]
+; CHECK-NEXT:    [[CMP:%.*]] = icmp slt <3 x i8> [[A:%.*]], <i8 43, i8 undef, i8 1>
+; CHECK-NEXT:    ret <3 x i1> [[CMP]]
 ;
-  %cmp = icmp sle <2 x i8> %a, <i8 undef, i8 0>
-  ret <2 x i1> %cmp
+  %cmp = icmp sle <3 x i8> %a, <i8 42, i8 undef, i8 0>
+  ret <3 x i1> %cmp
+}
+
+define <3 x i1> @PR27756_3(<3 x i8> %a) {
+; CHECK-LABEL: @PR27756_3(
+; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt <3 x i8> [[A:%.*]], <i8 undef, i8 0, i8 41>
+; CHECK-NEXT:    ret <3 x i1> [[CMP]]
+;
+  %cmp = icmp sge <3 x i8> %a, <i8 undef, i8 1, i8 42>
+  ret <3 x i1> %cmp
 }
 
 @someglobal = global i32 0


        


More information about the llvm-commits mailing list