From f170b85d40108446a9cbf30a9f504359ff3d1465 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 13 May 2018 18:26:06 +0000 Subject: [PATCH] [X86] Add missing test for the InstCombines of pclmulqdq. Apparently this test was lost when r293151 was committed. It was present in the review, but not the commit. llvm-svn: 332199 --- llvm/test/Transforms/InstCombine/X86/clmulqdq.ll | 80 ++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 llvm/test/Transforms/InstCombine/X86/clmulqdq.ll diff --git a/llvm/test/Transforms/InstCombine/X86/clmulqdq.ll b/llvm/test/Transforms/InstCombine/X86/clmulqdq.ll new file mode 100644 index 0000000..27cdf99 --- /dev/null +++ b/llvm/test/Transforms/InstCombine/X86/clmulqdq.ll @@ -0,0 +1,80 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt < %s -instcombine -S | FileCheck %s + +declare <2 x i64> @llvm.x86.pclmulqdq(<2 x i64>, <2 x i64>, i8) + +define <2 x i64> @test_demanded_elts_pclmulqdq_0(<2 x i64> %a0, <2 x i64> %a1) { +; CHECK-LABEL: @test_demanded_elts_pclmulqdq_0( +; CHECK-NEXT: [[TMP1:%.*]] = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> [[A0:%.*]], <2 x i64> [[A1:%.*]], i8 0) +; CHECK-NEXT: ret <2 x i64> [[TMP1]] +; + %1 = insertelement <2 x i64> %a0, i64 1, i64 1 + %2 = insertelement <2 x i64> %a1, i64 1, i64 1 + %3 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> %1, <2 x i64> %2, i8 0) + ret <2 x i64> %3 +} + +define <2 x i64> @test_demanded_elts_pclmulqdq_1(<2 x i64> %a0, <2 x i64> %a1) { +; CHECK-LABEL: @test_demanded_elts_pclmulqdq_1( +; CHECK-NEXT: [[TMP1:%.*]] = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> , <2 x i64> [[A1:%.*]], i8 1) +; CHECK-NEXT: ret <2 x i64> [[TMP1]] +; + %1 = insertelement <2 x i64> %a0, i64 1, i64 1 + %2 = insertelement <2 x i64> %a1, i64 1, i64 1 + %3 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> %1, <2 x i64> %2, i8 1) + ret <2 x i64> %3 +} + +define <2 x i64> @test_demanded_elts_pclmulqdq_16(<2 x i64> %a0, <2 x i64> %a1) { +; CHECK-LABEL: @test_demanded_elts_pclmulqdq_16( +; CHECK-NEXT: [[TMP1:%.*]] = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> [[A0:%.*]], <2 x i64> , i8 16) +; CHECK-NEXT: ret <2 x i64> [[TMP1]] +; + %1 = insertelement <2 x i64> %a0, i64 1, i64 1 + %2 = insertelement <2 x i64> %a1, i64 1, i64 1 + %3 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> %1, <2 x i64> %2, i8 16) + ret <2 x i64> %3 +} + +define <2 x i64> @test_demanded_elts_pclmulqdq_17(<2 x i64> %a0, <2 x i64> %a1) { +; CHECK-LABEL: @test_demanded_elts_pclmulqdq_17( +; CHECK-NEXT: [[TMP1:%.*]] = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> , <2 x i64> , i8 17) +; CHECK-NEXT: ret <2 x i64> [[TMP1]] +; + %1 = insertelement <2 x i64> %a0, i64 1, i64 1 + %2 = insertelement <2 x i64> %a1, i64 1, i64 1 + %3 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> %1, <2 x i64> %2, i8 17) + ret <2 x i64> %3 +} + +define <2 x i64> @test_demanded_elts_pclmulqdq_undef_0() { +; CHECK-LABEL: @test_demanded_elts_pclmulqdq_undef_0( +; CHECK-NEXT: ret <2 x i64> zeroinitializer +; + %1 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> , <2 x i64> , i8 0) + ret <2 x i64> %1 +} + +define <2 x i64> @test_demanded_elts_pclmulqdq_undef_1() { +; CHECK-LABEL: @test_demanded_elts_pclmulqdq_undef_1( +; CHECK-NEXT: ret <2 x i64> zeroinitializer +; + %1 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> , <2 x i64> , i8 1) + ret <2 x i64> %1 +} + +define <2 x i64> @test_demanded_elts_pclmulqdq_undef_16() { +; CHECK-LABEL: @test_demanded_elts_pclmulqdq_undef_16( +; CHECK-NEXT: ret <2 x i64> zeroinitializer +; + %1 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> , <2 x i64> , i8 16) + ret <2 x i64> %1 +} + +define <2 x i64> @test_demanded_elts_pclmulqdq_undef_17() { +; CHECK-LABEL: @test_demanded_elts_pclmulqdq_undef_17( +; CHECK-NEXT: ret <2 x i64> zeroinitializer +; + %1 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> , <2 x i64> , i8 17) + ret <2 x i64> %1 +} -- 2.7.4