diff options
| author | Roman Lebedev <lebedev.ri@gmail.com> | 2019-06-09 16:30:14 +0000 |
|---|---|---|
| committer | Roman Lebedev <lebedev.ri@gmail.com> | 2019-06-09 16:30:14 +0000 |
| commit | ff0c99b0177ddb091aea24576559dad6d00630ba (patch) | |
| tree | 39c44352e7fdc4ba181b9d54505fab553aee78f3 | |
| parent | 87cd16a86efbdfe0c8dd37645ac0d4bc5d6aeb86 (diff) | |
| download | bcm5719-llvm-ff0c99b0177ddb091aea24576559dad6d00630ba.tar.gz bcm5719-llvm-ff0c99b0177ddb091aea24576559dad6d00630ba.zip | |
[NFC][InstCombine] Revisit canonicalize-constant-low-bit-mask-and-icmp-s* tests in preparatio for PR42198.
The `icmp sgt`/`icmp sle` variants are, too, miscompiles:
https://rise4fun.com/Alive/JFNP
https://rise4fun.com/Alive/jHvL
A precondition 'x != 0' was forgotten by me.
While ensuring test coverage for `-1`, also add test coverage
for `0` mask. Mask `0` is allowed for all the folds,
mask `-1` is allowed for all the folds with unsigned `icmp` pred.
Constant mask `0` is missed though.
https://bugs.llvm.org/show_bug.cgi?id=42198
llvm-svn: 362910
10 files changed, 451 insertions, 227 deletions
diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-eq-to-icmp-ule.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-eq-to-icmp-ule.ll index f46bcdfc997..bb304d7fa96 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-eq-to-icmp-ule.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-eq-to-icmp-ule.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x u<= C ; Iff: isPowerOf2(C + 1) +; C can be 0 and -1. ; ============================================================================ ; ; Basic positive tests @@ -59,6 +60,26 @@ define <2 x i1> @p2_vec_nonsplat(<2 x i8> %x) { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase0(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase0( +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X:%.*]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp eq <2 x i8> [[TMP0]], [[X]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp eq <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} +define <2 x i1> @p2_vec_nonsplat_edgecase1(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase1( +; CHECK-NEXT: [[TMP1:%.*]] = icmp ule <2 x i8> [[X:%.*]], <i8 3, i8 -1> +; CHECK-NEXT: ret <2 x i1> [[TMP1]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 -1> + %ret = icmp eq <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef(<3 x i8> %x) { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[TMP1:%.*]] = icmp ult <3 x i8> [[X:%.*]], <i8 4, i8 undef, i8 4> diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ne-to-icmp-ugt.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ne-to-icmp-ugt.ll index 850266381e7..35ae2600c9a 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ne-to-icmp-ugt.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ne-to-icmp-ugt.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x u> C ; Iff: isPowerOf2(C + 1) +; C can be 0 and -1. ; ============================================================================ ; ; Basic positive tests @@ -59,6 +60,26 @@ define <2 x i1> @p2_vec_nonsplat(<2 x i8> %x) { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase0(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase0( +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X:%.*]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp ne <2 x i8> [[TMP0]], [[X]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp ne <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} +define <2 x i1> @p2_vec_nonsplat_edgecase1(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase1( +; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt <2 x i8> [[X:%.*]], <i8 3, i8 -1> +; CHECK-NEXT: ret <2 x i1> [[TMP1]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 -1> + %ret = icmp ne <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef(<3 x i8> %x) { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt <3 x i8> [[X:%.*]], <i8 3, i8 undef, i8 3> diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sge-to-icmp-sle.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sge-to-icmp-sle.ll index ca1b86c0623..3ed42e415c2 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sge-to-icmp-sle.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sge-to-icmp-sle.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x s<= C ; Iff: isPowerOf2(C + 1) +; C must not be -1, but may be 0. ; ============================================================================ ; ; Basic positive tests @@ -47,6 +48,17 @@ define <2 x i1> @p2_vec_nonsplat(<2 x i8> %x) { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase( +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X:%.*]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp sge <2 x i8> [[TMP0]], [[X]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp sge <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef(<3 x i8> %x) { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[TMP1:%.*]] = icmp slt <3 x i8> [[X:%.*]], <i8 4, i8 undef, i8 4> @@ -80,9 +92,7 @@ define i1 @oneuse0(i8 %x) { ; Negative tests ; ============================================================================ ; -; ============================================================================ ; ; Commutativity tests. -; ============================================================================ ; declare i8 @gen8() @@ -100,57 +110,7 @@ define i1 @c0() { } ; ============================================================================ ; -; Commutativity tests with variable -; ============================================================================ ; - -; Ok, this one should fold. We only testing commutativity of 'and'. -define i1 @cv0(i8 %y) { -; CHECK-LABEL: @cv0( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] -; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X]], [[TMP0]] -; CHECK-NEXT: [[RET:%.*]] = icmp sge i8 [[TMP1]], [[X]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = lshr i8 -1, %y - %tmp1 = and i8 %x, %tmp0 ; swapped order - %ret = icmp sge i8 %tmp1, %x - ret i1 %ret -} - -define i1 @cv1(i8 %y) { -; CHECK-LABEL: @cv1( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] -; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[TMP0]], [[X]] -; CHECK-NEXT: [[RET:%.*]] = icmp sge i8 [[X]], [[TMP1]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = lshr i8 -1, %y - %tmp1 = and i8 %tmp0, %x - %ret = icmp sge i8 %x, %tmp1 ; swapped order - ret i1 %ret -} - -define i1 @cv2(i8 %y) { -; CHECK-LABEL: @cv2( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] -; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X]], [[TMP0]] -; CHECK-NEXT: [[RET:%.*]] = icmp sge i8 [[X]], [[TMP1]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = lshr i8 -1, %y - %tmp1 = and i8 %x, %tmp0 ; swapped order - %ret = icmp sge i8 %x, %tmp1 ; swapped order - ret i1 %ret -} - -; ============================================================================ ; -; Normal negative tests +; Rest of negative tests ; ============================================================================ ; define i1 @n0(i8 %x) { @@ -224,3 +184,50 @@ define <3 x i1> @n4_vec(<3 x i8> %x) { %ret = icmp sge <3 x i8> %tmp0, %x ret <3 x i1> %ret } + +; Commutativity tests with variable + +define i1 @cv0(i8 %y) { +; CHECK-LABEL: @cv0( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X]], [[TMP0]] +; CHECK-NEXT: [[RET:%.*]] = icmp sge i8 [[TMP1]], [[X]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = lshr i8 -1, %y + %tmp1 = and i8 %x, %tmp0 ; swapped order + %ret = icmp sge i8 %tmp1, %x + ret i1 %ret +} + +define i1 @cv1(i8 %y) { +; CHECK-LABEL: @cv1( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[TMP0]], [[X]] +; CHECK-NEXT: [[RET:%.*]] = icmp sge i8 [[X]], [[TMP1]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = lshr i8 -1, %y + %tmp1 = and i8 %tmp0, %x + %ret = icmp sge i8 %x, %tmp1 ; swapped order + ret i1 %ret +} + +define i1 @cv2(i8 %y) { +; CHECK-LABEL: @cv2( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X]], [[TMP0]] +; CHECK-NEXT: [[RET:%.*]] = icmp sge i8 [[X]], [[TMP1]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = lshr i8 -1, %y + %tmp1 = and i8 %x, %tmp0 ; swapped order + %ret = icmp sge i8 %x, %tmp1 ; swapped order + ret i1 %ret +} diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sgt-to-icmp-sgt.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sgt-to-icmp-sgt.ll index 299ee78b7db..d58b93bf5ad 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sgt-to-icmp-sgt.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sgt-to-icmp-sgt.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x s> C ; Iff: isPowerOf2(C + 1) +; C must not be -1, but may be 0. ; NOTE: this pattern is not commutative! @@ -31,20 +32,6 @@ define i1 @p0() { ret i1 %ret } -define i1 @pv(i8 %y) { -; CHECK-LABEL: @pv( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] -; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i8 [[X]], [[TMP0]] -; CHECK-NEXT: ret i1 [[TMP1]] -; - %x = call i8 @gen8() - %tmp0 = lshr i8 -1, %y - %tmp1 = and i8 %tmp0, %x - %ret = icmp sgt i8 %x, %tmp1 - ret i1 %ret -} - ; ============================================================================ ; ; Vector tests ; ============================================================================ ; @@ -73,6 +60,19 @@ define <2 x i1> @p2_vec_nonsplat() { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase() { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp sgt <2 x i8> [[X]], [[TMP0]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp sgt <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef() { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[X:%.*]] = call <3 x i8> @gen3x8() @@ -110,9 +110,7 @@ define i1 @oneuse0() { ; Negative tests ; ============================================================================ ; -; ============================================================================ ; ; Commutativity tests. -; ============================================================================ ; define i1 @c0(i8 %x) { ; CHECK-LABEL: @c0( @@ -126,9 +124,92 @@ define i1 @c0(i8 %x) { } ; ============================================================================ ; -; Commutativity tests with variable +; Rest of negative tests ; ============================================================================ ; +define i1 @n0() { +; CHECK-LABEL: @n0( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = and i8 [[X]], 4 +; CHECK-NEXT: [[RET:%.*]] = icmp sgt i8 [[X]], [[TMP0]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = and i8 %x, 4 ; power-of-two, but invalid. + %ret = icmp sgt i8 %x, %tmp0 + ret i1 %ret +} + +define i1 @n1(i8 %y, i8 %notx) { +; CHECK-LABEL: @n1( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = and i8 [[X]], 3 +; CHECK-NEXT: [[RET:%.*]] = icmp sgt i8 [[TMP0]], [[NOTX:%.*]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = and i8 %x, 3 + %ret = icmp sgt i8 %tmp0, %notx ; not %x + ret i1 %ret +} + +define <2 x i1> @n2() { +; CHECK-LABEL: @n2( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X]], <i8 3, i8 16> +; CHECK-NEXT: [[RET:%.*]] = icmp sgt <2 x i8> [[X]], [[TMP0]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 16> ; only the first one is valid. + %ret = icmp sgt <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} + +; ============================================================================ ; +; Potential miscompiles. +; ============================================================================ ; + +define i1 @pv(i8 %y) { +; CHECK-LABEL: @pv( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i8 [[X]], [[TMP0]] +; CHECK-NEXT: ret i1 [[TMP1]] +; + %x = call i8 @gen8() + %tmp0 = lshr i8 -1, %y + %tmp1 = and i8 %tmp0, %x + %ret = icmp sgt i8 %x, %tmp1 + ret i1 %ret +} + +define <2 x i1> @n3_vec() { +; CHECK-LABEL: @n3_vec( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt <2 x i8> [[X]], <i8 3, i8 -1> +; CHECK-NEXT: ret <2 x i1> [[TMP1]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 -1> + %ret = icmp sgt <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} + +define <3 x i1> @n4_vec() { +; CHECK-LABEL: @n4_vec( +; CHECK-NEXT: [[X:%.*]] = call <3 x i8> @gen3x8() +; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt <3 x i8> [[X]], <i8 3, i8 undef, i8 -1> +; CHECK-NEXT: ret <3 x i1> [[TMP1]] +; + %x = call <3 x i8> @gen3x8() + %tmp0 = and <3 x i8> %x, <i8 3, i8 undef, i8 -1> + %ret = icmp sgt <3 x i8> %x, %tmp0 + ret <3 x i1> %ret +} + +; Commutativity tests with variable + ; Ok, this one should fold. We only testing commutativity of 'and'. define i1 @cv0_GOOD(i8 %y) { ; CHECK-LABEL: @cv0_GOOD( @@ -171,46 +252,3 @@ define i1 @cv2(i8 %x, i8 %y) { %ret = icmp sgt i8 %tmp1, %x ; swapped order ret i1 %ret } - -; ============================================================================ ; -; Normal negative tests -; ============================================================================ ; - -define i1 @n0() { -; CHECK-LABEL: @n0( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = and i8 [[X]], 4 -; CHECK-NEXT: [[RET:%.*]] = icmp sgt i8 [[X]], [[TMP0]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = and i8 %x, 4 ; power-of-two, but invalid. - %ret = icmp sgt i8 %x, %tmp0 - ret i1 %ret -} - -define i1 @n1(i8 %y, i8 %notx) { -; CHECK-LABEL: @n1( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = and i8 [[X]], 3 -; CHECK-NEXT: [[RET:%.*]] = icmp sgt i8 [[TMP0]], [[NOTX:%.*]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = and i8 %x, 3 - %ret = icmp sgt i8 %tmp0, %notx ; not %x - ret i1 %ret -} - -define <2 x i1> @n2() { -; CHECK-LABEL: @n2( -; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() -; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X]], <i8 3, i8 16> -; CHECK-NEXT: [[RET:%.*]] = icmp sgt <2 x i8> [[X]], [[TMP0]] -; CHECK-NEXT: ret <2 x i1> [[RET]] -; - %x = call <2 x i8> @gen2x8() - %tmp0 = and <2 x i8> %x, <i8 3, i8 16> ; only the first one is valid. - %ret = icmp sgt <2 x i8> %x, %tmp0 - ret <2 x i1> %ret -} diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sle-to-icmp-sle.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sle-to-icmp-sle.ll index 11596fc7540..47e10102c58 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sle-to-icmp-sle.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-sle-to-icmp-sle.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x s<= C ; Iff: isPowerOf2(C + 1) +; C must not be -1, but may be 0. ; NOTE: this pattern is not commutative! @@ -31,20 +32,6 @@ define i1 @p0() { ret i1 %ret } -define i1 @pv(i8 %y) { -; CHECK-LABEL: @pv( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] -; CHECK-NEXT: [[TMP1:%.*]] = icmp sle i8 [[X]], [[TMP0]] -; CHECK-NEXT: ret i1 [[TMP1]] -; - %x = call i8 @gen8() - %tmp0 = lshr i8 -1, %y - %tmp1 = and i8 %tmp0, %x - %ret = icmp sle i8 %x, %tmp1 - ret i1 %ret -} - ; ============================================================================ ; ; Vector tests ; ============================================================================ ; @@ -73,6 +60,19 @@ define <2 x i1> @p2_vec_nonsplat() { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase() { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp sle <2 x i8> [[X]], [[TMP0]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp sle <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef() { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[X:%.*]] = call <3 x i8> @gen3x8() @@ -110,9 +110,7 @@ define i1 @oneuse0() { ; Negative tests ; ============================================================================ ; -; ============================================================================ ; ; Commutativity tests. -; ============================================================================ ; define i1 @c0(i8 %x) { ; CHECK-LABEL: @c0( @@ -126,10 +124,92 @@ define i1 @c0(i8 %x) { } ; ============================================================================ ; -; Commutativity tests with variable +; Rest of negative tests ; ============================================================================ ; -; Ok, this one should fold. We only testing commutativity of 'and'. +define i1 @n0() { +; CHECK-LABEL: @n0( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = and i8 [[X]], 4 +; CHECK-NEXT: [[RET:%.*]] = icmp sle i8 [[X]], [[TMP0]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = and i8 %x, 4 ; power-of-two, but invalid. + %ret = icmp sle i8 %x, %tmp0 + ret i1 %ret +} + +define i1 @n1(i8 %y, i8 %notx) { +; CHECK-LABEL: @n1( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = and i8 [[X]], 3 +; CHECK-NEXT: [[RET:%.*]] = icmp sle i8 [[TMP0]], [[NOTX:%.*]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = and i8 %x, 3 + %ret = icmp sle i8 %tmp0, %notx ; not %x + ret i1 %ret +} + +define <2 x i1> @n2() { +; CHECK-LABEL: @n2( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X]], <i8 3, i8 16> +; CHECK-NEXT: [[RET:%.*]] = icmp sle <2 x i8> [[X]], [[TMP0]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 16> ; only the first one is valid. + %ret = icmp sle <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} + +; ============================================================================ ; +; Potential miscompiles. +; ============================================================================ ; + +define i1 @pv(i8 %y) { +; CHECK-LABEL: @pv( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = icmp sle i8 [[X]], [[TMP0]] +; CHECK-NEXT: ret i1 [[TMP1]] +; + %x = call i8 @gen8() + %tmp0 = lshr i8 -1, %y + %tmp1 = and i8 %tmp0, %x + %ret = icmp sle i8 %x, %tmp1 + ret i1 %ret +} + +define <2 x i1> @n3_vec() { +; CHECK-LABEL: @n3_vec( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP1:%.*]] = icmp slt <2 x i8> [[X]], <i8 4, i8 0> +; CHECK-NEXT: ret <2 x i1> [[TMP1]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 -1> + %ret = icmp sle <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} + +define <3 x i1> @n4_vec() { +; CHECK-LABEL: @n4_vec( +; CHECK-NEXT: [[X:%.*]] = call <3 x i8> @gen3x8() +; CHECK-NEXT: [[TMP1:%.*]] = icmp slt <3 x i8> [[X]], <i8 4, i8 undef, i8 0> +; CHECK-NEXT: ret <3 x i1> [[TMP1]] +; + %x = call <3 x i8> @gen3x8() + %tmp0 = and <3 x i8> %x, <i8 3, i8 undef, i8 -1> + %ret = icmp sle <3 x i8> %x, %tmp0 + ret <3 x i1> %ret +} + +; Commutativity tests with variable + define i1 @cv0_GOOD(i8 %y) { ; CHECK-LABEL: @cv0_GOOD( ; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() @@ -171,46 +251,3 @@ define i1 @cv2(i8 %x, i8 %y) { %ret = icmp sle i8 %tmp1, %x ; swapped order ret i1 %ret } - -; ============================================================================ ; -; Normal negative tests -; ============================================================================ ; - -define i1 @n0() { -; CHECK-LABEL: @n0( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = and i8 [[X]], 4 -; CHECK-NEXT: [[RET:%.*]] = icmp sle i8 [[X]], [[TMP0]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = and i8 %x, 4 ; power-of-two, but invalid. - %ret = icmp sle i8 %x, %tmp0 - ret i1 %ret -} - -define i1 @n1(i8 %y, i8 %notx) { -; CHECK-LABEL: @n1( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = and i8 [[X]], 3 -; CHECK-NEXT: [[RET:%.*]] = icmp sle i8 [[TMP0]], [[NOTX:%.*]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = and i8 %x, 3 - %ret = icmp sle i8 %tmp0, %notx ; not %x - ret i1 %ret -} - -define <2 x i1> @n2() { -; CHECK-LABEL: @n2( -; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() -; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X]], <i8 3, i8 16> -; CHECK-NEXT: [[RET:%.*]] = icmp sle <2 x i8> [[X]], [[TMP0]] -; CHECK-NEXT: ret <2 x i1> [[RET]] -; - %x = call <2 x i8> @gen2x8() - %tmp0 = and <2 x i8> %x, <i8 3, i8 16> ; only the first one is valid. - %ret = icmp sle <2 x i8> %x, %tmp0 - ret <2 x i1> %ret -} diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-slt-to-icmp-sgt.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-slt-to-icmp-sgt.ll index 2957ad5731c..7cda5727272 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-slt-to-icmp-sgt.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-slt-to-icmp-sgt.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x s> C ; Iff: isPowerOf2(C + 1) +; C must not be -1, but may be 0. ; ============================================================================ ; ; Basic positive tests @@ -47,6 +48,17 @@ define <2 x i1> @p2_vec_nonsplat(<2 x i8> %x) { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase( +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X:%.*]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp slt <2 x i8> [[TMP0]], [[X]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp slt <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef(<3 x i8> %x) { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt <3 x i8> [[X:%.*]], <i8 3, i8 undef, i8 3> @@ -80,9 +92,7 @@ define i1 @oneuse0(i8 %x) { ; Negative tests ; ============================================================================ ; -; ============================================================================ ; ; Commutativity tests. -; ============================================================================ ; declare i8 @gen8() @@ -100,57 +110,7 @@ define i1 @c0() { } ; ============================================================================ ; -; Commutativity tests with variable -; ============================================================================ ; - -; Ok, this one should fold. We only testing commutativity of 'and'. -define i1 @cv0(i8 %y) { -; CHECK-LABEL: @cv0( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] -; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X]], [[TMP0]] -; CHECK-NEXT: [[RET:%.*]] = icmp slt i8 [[TMP1]], [[X]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = lshr i8 -1, %y - %tmp1 = and i8 %x, %tmp0 ; swapped order - %ret = icmp slt i8 %tmp1, %x - ret i1 %ret -} - -define i1 @cv1(i8 %y) { -; CHECK-LABEL: @cv1( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] -; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[TMP0]], [[X]] -; CHECK-NEXT: [[RET:%.*]] = icmp slt i8 [[X]], [[TMP1]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = lshr i8 -1, %y - %tmp1 = and i8 %tmp0, %x - %ret = icmp slt i8 %x, %tmp1 ; swapped order - ret i1 %ret -} - -define i1 @cv2(i8 %y) { -; CHECK-LABEL: @cv2( -; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() -; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] -; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X]], [[TMP0]] -; CHECK-NEXT: [[RET:%.*]] = icmp slt i8 [[X]], [[TMP1]] -; CHECK-NEXT: ret i1 [[RET]] -; - %x = call i8 @gen8() - %tmp0 = lshr i8 -1, %y - %tmp1 = and i8 %x, %tmp0 ; swapped order - %ret = icmp slt i8 %x, %tmp1 ; swapped order - ret i1 %ret -} - -; ============================================================================ ; -; Normal negative tests +; Rest of negative tests ; ============================================================================ ; define i1 @n0(i8 %x) { @@ -224,3 +184,50 @@ define <3 x i1> @n4(<3 x i8> %x) { %ret = icmp slt <3 x i8> %tmp0, %x ret <3 x i1> %ret } + +; Commutativity tests with variable + +define i1 @cv0(i8 %y) { +; CHECK-LABEL: @cv0( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X]], [[TMP0]] +; CHECK-NEXT: [[RET:%.*]] = icmp slt i8 [[TMP1]], [[X]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = lshr i8 -1, %y + %tmp1 = and i8 %x, %tmp0 ; swapped order + %ret = icmp slt i8 %tmp1, %x + ret i1 %ret +} + +define i1 @cv1(i8 %y) { +; CHECK-LABEL: @cv1( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[TMP0]], [[X]] +; CHECK-NEXT: [[RET:%.*]] = icmp slt i8 [[X]], [[TMP1]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = lshr i8 -1, %y + %tmp1 = and i8 %tmp0, %x + %ret = icmp slt i8 %x, %tmp1 ; swapped order + ret i1 %ret +} + +define i1 @cv2(i8 %y) { +; CHECK-LABEL: @cv2( +; CHECK-NEXT: [[X:%.*]] = call i8 @gen8() +; CHECK-NEXT: [[TMP0:%.*]] = lshr i8 -1, [[Y:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = and i8 [[X]], [[TMP0]] +; CHECK-NEXT: [[RET:%.*]] = icmp slt i8 [[X]], [[TMP1]] +; CHECK-NEXT: ret i1 [[RET]] +; + %x = call i8 @gen8() + %tmp0 = lshr i8 -1, %y + %tmp1 = and i8 %x, %tmp0 ; swapped order + %ret = icmp slt i8 %x, %tmp1 ; swapped order + ret i1 %ret +} diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-uge-to-icmp-ule.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-uge-to-icmp-ule.ll index f17d6b47a08..18325ed1759 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-uge-to-icmp-ule.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-uge-to-icmp-ule.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x u<= C ; Iff: isPowerOf2(C + 1) +; C can be 0 and -1. ; ============================================================================ ; ; Basic positive tests @@ -59,6 +60,26 @@ define <2 x i1> @p2_vec_nonsplat(<2 x i8> %x) { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase0(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase0( +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X:%.*]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp uge <2 x i8> [[TMP0]], [[X]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp uge <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} +define <2 x i1> @p2_vec_nonsplat_edgecase1(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase1( +; CHECK-NEXT: [[TMP1:%.*]] = icmp ule <2 x i8> [[X:%.*]], <i8 3, i8 -1> +; CHECK-NEXT: ret <2 x i1> [[TMP1]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 -1> + %ret = icmp uge <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef(<3 x i8> %x) { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[TMP1:%.*]] = icmp ult <3 x i8> [[X:%.*]], <i8 4, i8 undef, i8 4> diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ugt-to-icmp-ugt.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ugt-to-icmp-ugt.ll index 7512b72f2a7..38a57d6d267 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ugt-to-icmp-ugt.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ugt-to-icmp-ugt.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x u> C ; Iff: isPowerOf2(C + 1) +; C can be 0 and -1. declare i8 @gen8() declare <2 x i8> @gen2x8() @@ -71,6 +72,30 @@ define <2 x i1> @p2_vec_nonsplat() { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase0() { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase0( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp ugt <2 x i8> [[X]], [[TMP0]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp ugt <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} +define <2 x i1> @p2_vec_nonsplat_edgecase1() { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase1( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt <2 x i8> [[X]], <i8 3, i8 -1> +; CHECK-NEXT: ret <2 x i1> [[TMP1]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 -1> + %ret = icmp ugt <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef() { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[X:%.*]] = call <3 x i8> @gen3x8() diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ule-to-icmp-ule.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ule-to-icmp-ule.ll index 0bab709618d..6f267206dbe 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ule-to-icmp-ule.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ule-to-icmp-ule.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x u<= C ; Iff: isPowerOf2(C + 1) +; C can be 0 and -1. declare i8 @gen8() declare <2 x i8> @gen2x8() @@ -71,6 +72,30 @@ define <2 x i1> @p2_vec_nonsplat() { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase0() { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase0( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp ule <2 x i8> [[X]], [[TMP0]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp ule <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} +define <2 x i1> @p2_vec_nonsplat_edgecase1() { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase1( +; CHECK-NEXT: [[X:%.*]] = call <2 x i8> @gen2x8() +; CHECK-NEXT: [[TMP1:%.*]] = icmp ule <2 x i8> [[X]], <i8 3, i8 -1> +; CHECK-NEXT: ret <2 x i1> [[TMP1]] +; + %x = call <2 x i8> @gen2x8() + %tmp0 = and <2 x i8> %x, <i8 3, i8 -1> + %ret = icmp ule <2 x i8> %x, %tmp0 + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef() { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[X:%.*]] = call <3 x i8> @gen3x8() diff --git a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ult-to-icmp-ugt.ll b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ult-to-icmp-ugt.ll index 287e3699932..ad0f0cf3c0e 100644 --- a/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ult-to-icmp-ugt.ll +++ b/llvm/test/Transforms/InstCombine/canonicalize-constant-low-bit-mask-and-icmp-ult-to-icmp-ugt.ll @@ -8,6 +8,7 @@ ; Should be transformed into: ; x u> C ; Iff: isPowerOf2(C + 1) +; C can be 0 and -1. ; ============================================================================ ; ; Basic positive tests @@ -59,6 +60,27 @@ define <2 x i1> @p2_vec_nonsplat(<2 x i8> %x) { ret <2 x i1> %ret } +define <2 x i1> @p2_vec_nonsplat_edgecase0(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase0( +; CHECK-NEXT: [[TMP0:%.*]] = and <2 x i8> [[X:%.*]], <i8 3, i8 0> +; CHECK-NEXT: [[RET:%.*]] = icmp ult <2 x i8> [[TMP0]], [[X]] +; CHECK-NEXT: ret <2 x i1> [[RET]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 0> + %ret = icmp ult <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} + +define <2 x i1> @p2_vec_nonsplat_edgecase1(<2 x i8> %x) { +; CHECK-LABEL: @p2_vec_nonsplat_edgecase1( +; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt <2 x i8> [[X:%.*]], <i8 3, i8 -1> +; CHECK-NEXT: ret <2 x i1> [[TMP1]] +; + %tmp0 = and <2 x i8> %x, <i8 3, i8 -1> + %ret = icmp ult <2 x i8> %tmp0, %x + ret <2 x i1> %ret +} + define <3 x i1> @p3_vec_splat_undef(<3 x i8> %x) { ; CHECK-LABEL: @p3_vec_splat_undef( ; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt <3 x i8> [[X:%.*]], <i8 3, i8 undef, i8 3> |

