From fe5292545f768592fa1d8881c3b8c1bca43f8dfb Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 29 Oct 2019 09:39:46 -0400 Subject: [PATCH] [InstCombine] add tests for icmp predicate canonicalization with vector types; NFC Increase coverage for D69519. --- llvm/test/Transforms/InstCombine/icmp-vec.ll | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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:%.*]], -; CHECK-NEXT: ret <2 x i1> [[CMP]] +; CHECK-NEXT: [[CMP:%.*]] = icmp slt <3 x i8> [[A:%.*]], +; CHECK-NEXT: ret <3 x i1> [[CMP]] ; - %cmp = icmp sle <2 x i8> %a, - ret <2 x i1> %cmp + %cmp = icmp sle <3 x i8> %a, + 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:%.*]], +; CHECK-NEXT: ret <3 x i1> [[CMP]] +; + %cmp = icmp sge <3 x i8> %a, + ret <3 x i1> %cmp } @someglobal = global i32 0