diff options
| -rw-r--r-- | llvm/test/Transforms/InstCombine/vector-casts.ll | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/vector-casts.ll b/llvm/test/Transforms/InstCombine/vector-casts.ll index fe0b560ed14..4b43b9df1d7 100644 --- a/llvm/test/Transforms/InstCombine/vector-casts.ll +++ b/llvm/test/Transforms/InstCombine/vector-casts.ll @@ -2,8 +2,9 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s ; This turns into a&1 != 0 -define <2 x i1> @test1(<2 x i64> %a) { -; CHECK-LABEL: @test1( + +define <2 x i1> @trunc(<2 x i64> %a) { +; CHECK-LABEL: @trunc( ; CHECK-NEXT: [[TMP1:%.*]] = and <2 x i64> [[A:%.*]], <i64 1, i64 1> ; CHECK-NEXT: [[T:%.*]] = icmp ne <2 x i64> [[TMP1]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[T]] @@ -12,6 +13,17 @@ define <2 x i1> @test1(<2 x i64> %a) { ret <2 x i1> %t } +define <2 x i1> @and_cmp_is_trunc(<2 x i64> %a) { +; CHECK-LABEL: @and_cmp_is_trunc( +; CHECK-NEXT: [[T:%.*]] = and <2 x i64> [[A:%.*]], <i64 1, i64 1> +; CHECK-NEXT: [[R:%.*]] = icmp ne <2 x i64> [[T]], zeroinitializer +; CHECK-NEXT: ret <2 x i1> [[R]] +; + %t = and <2 x i64> %a, <i64 1, i64 1> + %r = icmp ne <2 x i64> %t, zeroinitializer + ret <2 x i1> %r +} + ; The ashr turns into an lshr. define <2 x i64> @test2(<2 x i64> %a) { ; CHECK-LABEL: @test2( |

